Friday, 11 March 2016

reRead( ) in AX 2009 - Best Advantage

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 : 



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

tSalesLine.reRead( );

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

tSalesLine.update( );


No comments:

Post a Comment