Temp table(InMemory) buffer usage in the same instance – Microsoft Dynamics 365 for Finance and Operations – Ax2012 – X++

Posted by

Scenario: Sometime you have to use InMemory table buffer to apply some logic within the same buffer.

Solution: The solution is to use the sameTable variable by using SetTempData

 

//local variable

TempTable localTempTable;

;

// set the data to the local tmp table from the original tmp table

localTempTable.setTmpData(originalTmpTable);

ttsbegin;

while select forupdate localTempTable //where localTempTable.somecoindtion ==

{

localTempTable.someField = ”;

localTempTable.update();

}

ttscommit;

//at the end  after completing the loop set the tmp data back to the original tmp data

originalTmpTable.setTmpData(localTempTable);

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.