AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.11.2010, 09:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
Preston.Larimer: Dynamic selection criteria in X++
Источник: http://palarimer.greenlight2go.com/2...eria-in-x.html
==============


Occasionally I’ve had a situation where using a while select statement to loop through a set of records and needed the fields used in the selection criteria to be dynamic based on arguments passed to the method. Dynamics AX offers a slick way of dealing with this that is used in the standard application code but is still pretty obscure. The following method demonstrates using a variable select statement based on passed in arguments and using the NEXT keyword to move the record set forward. In this example we’re just outputting the Item ID to an info log but you could get much more creative….

X++:
void SelectNextSample(salesID _salesID, inventtransID _inventTransID = '')
{    
    salesLine salesLine;    
    ;        

    if (_inventTransID)    
    {        
        select salesLine where salesLine.SalesId == _salesID && salesLine.InventTransId == _inventTransID;    
    }
    else
    {        
        select salesLine where salesLine.SalesId == _salesID;    
    }

    while (salesLine)    
    {        
        info(salesLine.ItemId);
        next salesLine;    
    }
}


Источник: http://palarimer.greenlight2go.com/2...eria-in-x.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Preston.Larimer: Item import from CSV file made easy (Kinda) Blog bot DAX Blogs 3 15.11.2010 12:26
Preston.Larimer: Workflow setup error on Event Log name Blog bot DAX Blogs 0 14.11.2010 10:18
Microsoft Dynamics CRM Team Blog: Marketing with Dynamic List Blog bot Dynamics CRM: Blogs 0 09.11.2010 19:05
Microsoft Dynamics CRM Team Blog: Dynamic Export to Excel feature – How to protect data over the wire Blog bot Dynamics CRM: Blogs 0 27.01.2009 10:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 17:37.