Quantcast
Channel: AX Developer Forum
Viewing all articles
Browse latest Browse all 9880

How to Edit address using X++ in AX 2012 ?

$
0
0

I have a address filled corresponding to a Customer record in AX 2012. Now, My requirement is to Select Address from Address tab of a Edit Customer form and then to update the same using X++ Code.. I have tried to perform below code after passing current Party and Location ID..

obj_DirParty = DirParty::constructFromPartyRecId(obj_partyTable.RecId );    
  obj_DirParty.createOrUpdatePostalAddress(obj_postalAddress, formRun.purposecon()

 

But it is throwing error saying... Microsoft Dynamics AX Views are read only. So ultimately I have to press ESC button to disallow changes, however a new record is being added in a DirpartyPostalAddressView and I am able to see my changes before pressing ESC in a form. But after pressing ESC, Chages being made to LogisticsLocation table record changes to previous data. My question is How to avoid this error so I can get my updated data in a form.


Viewing all articles
Browse latest Browse all 9880

Trending Articles