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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 02.03.2012, 01:18   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
How to make a temporary instance of a database table to be shown on the form
Источник: http://alexvoy.blogspot.com/2012/03/...stance-of.html
==============

This short code shows how to work with a temporary table without creating it in AOT.

X++:
// how to use temporary table
// method Init of the form
public void init()
{
    WmpInventNutrition        nut; // regular table in AOT
    WmpInventNutrition        tmp; // instead of creating in AOT a temporary table
                                   // we can create a temporary instance of the preivous regular table
    ;
     super();

    // here we make it temporary;
    // it will disappear from memory when loses the scope
    // in other words, when we close the form
    tmp.setTmp();

    // simply selecting some of records from the regular table
    while select nut
        where nut.ItemId like '_wmp*'
    {
        // and putting them in the temporary one
        tmp.data(nut);
        tmp.doInsert();
    }
    // finally to show them on the form
    // we set the form data source to the temporary table
    wmpInventNutrition.setTmp();
    wmpInventNutrition.setTmpData(tmp);
}


Alternatively, if you know exactly how the field match, it will be faster to use insert_recordset:


X++:
 // simply selecting some of records from the regular table
    tmp.skipDataMethods();
    insert_recordSet tmp (itemid) select ItemId from nut where nut.ItemId like '_wmp*';

Источник: http://alexvoy.blogspot.com/2012/03/...stance-of.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.

Последний раз редактировалось Poleax; 02.03.2012 в 10:47. Причина: оформление
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Paint it black: How to color rows in Table form control Blog bot DAX Blogs 0 12.07.2011 02:11
dynamicsaxtraining: How to make data from temporary table available in form’s grid Blog bot DAX Blogs 0 04.12.2010 01:11
emeadaxsupport: Wrong data shown in the grid, if the table field is an Int 64 and the form control is an IntEdit instead of an int64edit. Blog bot DAX Blogs 3 22.07.2010 18:00
CRM DE LA CREME! Some more useful javascripts for MS CRM Blog bot Dynamics CRM: Blogs 0 04.05.2010 11:05
PatrickChua: Temporary table Blog bot DAX Blogs 0 04.05.2009 14:05

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

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

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