How to update contact in Dynamics AX 2012 Through X++
How to update contact in Dynamics AX 2012 Through X++
DirPartyContactInfoView dirPartyContactInfo;
DirParty dirParty;
LogisticsLocation location;
VendTable vendTable = VendTable::find("Vendor number");
container roles;
location = LogisticsLocation::create("Phone", false);
DirParty::addLocation(vendTable.Party, location.RecId, false, true);
dirParty = DirParty::constructFromCommon(vendTable);
dirPartyContactInfo.LocationName = "Phone";
dirPartyContactInfo.Location = location.RecId;
dirPartyContactInfo.Locator = "1112222";
dirPartyContactInfo.IsPrimary = NoYes::No;
dirPartyContactInfo.Type = LogisticsElectronicAddressMethodType::Phone;
dirPartyContactInfo.Party = vendTable.Party;
dirPartyContactInfo.IsPrimary = NoYes::Yes;
roles = [LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Business).RecId];
dirParty.createOrUpdateContactInfo(dirPartyContactInfo,roles);
DirPartyContactInfoView dirPartyContactInfo;
DirParty dirParty;
LogisticsLocation location;
VendTable vendTable = VendTable::find("Vendor number");
container roles;
location = LogisticsLocation::create("Phone", false);
DirParty::addLocation(vendTable.Party, location.RecId, false, true);
dirParty = DirParty::constructFromCommon(vendTable);
dirPartyContactInfo.LocationName = "Phone";
dirPartyContactInfo.Location = location.RecId;
dirPartyContactInfo.Locator = "1112222";
dirPartyContactInfo.IsPrimary = NoYes::No;
dirPartyContactInfo.Type = LogisticsElectronicAddressMethodType::Phone;
dirPartyContactInfo.Party = vendTable.Party;
dirPartyContactInfo.IsPrimary = NoYes::Yes;
roles = [LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Business).RecId];
dirParty.createOrUpdateContactInfo(dirPartyContactInfo,roles);
Comments
Post a Comment