Hi, I’m working in AX 2012 creating customers and their addresses in X++. I am also adding phone numbers and email addresses to the postal address, by using this code:
DirPartyContactInvfoView;
DirParty dirParty = new DirParty(dirPerson);
dirPartyContactInfo.LocationName = “Main email”;
dirPartyContactInfo.Locator = test@mail.com";
dirPartyContactInfo.Type = LogisticsElectronicAddressMethodType::Email;
dirPartyContactInfo.IsPrimary = NoYes::Yes;
dirParty.createOrUpdateContactInfo(dirPartyContactInfo);
It works great, however, when I add more than one address, I don’t know how to add contact information (phone, email) for those extra addresses, because these contacts that I’m currently creating remains in the “main” form:
Instead of being assigned to each addresses, which is what I need, so they appear in this area for each address:
Any idea how to assign contacts to specific addresses using X++? I would appreciate your help, thanks!