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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 11.05.2009, 19:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
axStart: Updating records and calling super
Источник: http://axstart.spaces.live.com/Blog/...C0A0!549.entry
==============

Last week I was programming x++. I had to create the following code.

Before a record in AX gets updated an external application gets started. This external application is able to do additional update on the same record in AX by using AIF. As the performance of the external route is slow, an additional check is needed to start this process only if needed.

So what do we have?

A.      Do I need to compare this with this.orig() before or after super?

B.      Do I need to call this external application before or after super?

If we call the external application before super, AX will complain that another user has updated the record. So we have to do it after super.  Fine, but what happens…. After super the original record gets equal to the current record.  Ouch so the difference between the record and the original record only exists before super.  The solution is to make a local buffer variable in the update method that references the original record before calling super. This buffer will still be used after calling super.

Example:

void update()

{

    CustTable ctBuffer = this.orig();

    Super();

    If(this.name !=  ctBuffer.name)

       //call external application

}

 




Источник: http://axstart.spaces.live.com/Blog/...C0A0!549.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
calling SQL sp from Axapta gb DAX in English 6 15.07.2005 00:39

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

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

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