This is X++ Code to create Customer Delivery Address in Axapta , This code can help you for Ax 2012 and D365 FnO also.
LogisticsPostalAddress address;
custtable = Custtable::find("1223");
address.Street = “abc”;
address.ZipCode = “334223”;
address.City = “xt”;
addressView.Party = CustTable.Party;
addressview.initFromPostalAddress(address);
DirParty = DirParty::constructFromPartyRecId(CustTable.Party);
roles = [LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Delivery).RecId];
DirParty.createOrUpdatePostalAddress(addressView,roles);
Comments