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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.10.2006, 16:40   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Dynamics AX Geek: Interesting fact about set(Types::Record)
Источник: http://AxGeek.spaces.live.com/Blog/c...DB13!144.entry
==============
Sets can store data of type record. By definition sets only store unique data, right? So, if you use this construct you should be aware that recId is not taken into account when determining whether a record is already in the set or not.
Now, in some tables it can be perfectly normal to have records whose only difference is the recId. If you need all instances of these records in your memory storage (set) for further processing, you are better of using a different construct like a recordSortedList, recordInsertList or maybe a map.
Take inventTrans for example: run the job below on your test system. If you do get a match of set elements and inventTrans records try this:
Add a sales order line, any item, qty = 2. Go to the inventory transaction, functions/split and make two transactions out of one. Now run the job again.
 
The result in my test company:
214 records in inventTrans
213 records in record set
 
static void SetDuplicates(Args _args)
{
    inventTrans inventTrans;
    set         recordSet = new set(types::Record);
    int         recordCnt = 0;
    ;
 
    while select inventTrans
    {
        recordSet.add(inventTrans);
        recordCnt++;
    }
 
    print strfmt("%1 records in inventTrans",recordCnt);
    print strfmt("%1 records in record set ",recordSet.elements());
    pause;
} 




==============
Источник: http://AxGeek.spaces.live.com/Blog/c...DB13!144.entry
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Inside Dynamics AX 4.0: The Security Framework Blog bot DAX Blogs 0 31.10.2007 11:40
Inside Dynamics AX 4.0: Usage Scenarios Blog bot DAX Blogs 0 04.10.2007 05:15
Inside Dynamics AX 4.0: Inside the Business Connector Blog bot DAX Blogs 0 04.10.2007 05:15
Dynamics AX: Why Dynamics AX beats SAP Blog bot DAX Blogs 0 10.01.2007 23:15

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 01:57.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.