Search This Blog

Wednesday, October 30, 2013

reRead( ) in AX 2009 - Best Advantage

Hi Friends,

I hope all of you may already know about this, but I am forced to post it here.

To avoid most of the UpdateConflicts / DeadLock errors while update a record in a table, just use the "reRead( )" method of the table before making any changes to the selected record of the table.

Ex :

;

ttsbegin;

select forUpdate tSalesLine where tSalesLine.SalesId = = 'SO-1234567';

tSalesLine.reRead( );

tSalesLine.Feild1 = XXXXX;
tSalesLine.Feild2 = XXXXX;

tSalesLine.update( );

ttscommit;

Happy Daxing..
AX Dude.

No comments:

Post a Comment