Hi,
i want to update email of a customer with new roles (purpose - invoice) its blank currently, my code is below:
this issue is i get two addresses, one with purpose invoice, one without it, how do i update correctly ? i do this over customers v3 entity
DirParty dirParty;
DirPartyContactInfoView dirPartyContactInfoView;
container roles;
ttsbegin;
dirParty = DirParty::constructFromPartyRecId(DirPartyTable::findByNum(this.PartyNumber).RecId);
roles = [LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Invoice).RecId];
dirPartyContactInfoView.Type = LogisticsElectronicAddressMethodType::Email;
dirPartyContactInfoView.Locator = this.PrimaryContactEmail;
dirPartyContactInfoView.IsPrimary = NoYes::Yes;
dirPartyContactInfoView.Party = DirPartyTable::findByNum(this.PartyNumber).RecId;
dirPartyContactInfoView.LocationId = this.ElectronicLocationId;
dirPartyContactInfoView.Location = DirPartyLocation::findOrCreate(dirPartyContactInfoView.Party, 0).Location;
dirParty.createOrUpdateContactInfo(dirPartyContactInfoView, roles);
ttscommit;