How to update address in Dynamics AX 2012 Through X++
How to update address in Dynamics AX 2012 Through X++
DirPartyPostalAddressView dirPartyPostalAddressView;
DirParty dirParty;
VendTable vendTable = VendTable::find("Vendor number");
dirParty = DirParty::constructFromCommon(vendTable);
select dirPartyPostalAddressView where dirPartyPostalAddressView.Party == vendTable.Party && dirPartyPostalAddressView.IsPrimary == true;
dirPartyPostalAddressView.CountryRegionId = "Jor";
dirPartyPostalAddressView.ZipCode = "11";
dirPartyPostalAddressView.Street = "";
dirPartyPostalAddressView.City = "Amman";
dirPartyPostalAddressView.DistrictName = "";
dirPartyPostalAddressView.State = "";
dirPartyPostalAddressView.County = "";
dirPartyPostalAddressView.IsPrimary = true;
dirPartyPostalAddressView.Party = vendTable.Party;
dirParty.createOrUpdatePostalAddress(dirPartyPostalAddressView);
Comments
Post a Comment