web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

how to update data inside AX table using x++ ?

Abdel Fatah Ahmed Profile Picture Abdel Fatah Ahmed

some times you need to modify some data for example Name of item how to this using x++ in AX 2009 

this lines of code will help you to do this :

void modifyitemprice ()

{

inventtable inv;

;

while select forupdate inv  where inv.itemid == "MPARA50T"

{

if(inv)

{

ttsbegin;

inv.ItemName="Paracetamol 50MG Tablet ";

inv.update();

ttscommit;

}

}

}

first you have to select what you need using select forupdate and put your criteria in where clause 

and then put the new value in the field(s) you want to update it and the you have to call the update method

and the important thing for updating put the update code inside

ttsbegin;

// your code 

ttscommit; 

Comments

*This post is locked for comments