如何确定哪个字段已更新?

Nic*_*ico 4 x++ axapta dynamics-ax-2009

确定update()表中方法中哪个字段已更改的正确方法是什么?

我知道这可能是在modifiedField()via,fieldId但现在还为时尚早.

Dav*_*son 5

你正在寻找的方法是Orig()

查看BOMTable或BankAccountTrans的update()方法

该表有一个名为orig的方法,它公开当前记录的上次保存状态的值.

一个很好的例子和描述可以在这里找到 http://msdax.blogspot.co.uk/2007/07/programming-of-basic-methods-of-tables.html

 void update () {
     CustTable this_Orig = this.orig ();
     ;

     if (this_Orig.custGroup! = this.custGroup)
     {
       //Cust group is changing on this update
     }
     ...
Run Code Online (Sandbox Code Playgroud)