Hi,
I'm working on the customer address update on the X++. Able to update the address details, but I cannot update the roles in that address. I had mentioned the code which I'm trying.
Code:
LogisticsPostalAddress address;
Custtable custtable;
DirPartyPostalAddressView addressView;
DirParty DirParty;
container roles;
custtable = Custtable::find("902536");
address.Location = 22565428539;
address.CountryRegionId = "USA";
address.State = "NY";
address.Street = "34";
address.ZipCode = "10119";
address.City = "new york";
addressView.Party = CustTable.Party;
addressview.initFromPostalAddress(address);
addressView.locationRoles();
DirParty = DirParty::constructFromPartyRecId(CustTable.Party);
roles = [LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Home).RecId];
DirParty.createOrUpdatePostalAddress(addressView, roles);
If I add the "address.Location = 22565428539;" means it update the address but it didn't update role detail. Can you give me the solution for it!!!
*This post is locked for comments