Full width home advertisement

Post Page Advertisement [Top]

Create or Update a Contact Information for a customer/vendor in X++ [AX 2012 R3]

static void RB_SupplierAddress_RoleUpdate(Args _args)

{

    VendTable                           VendTable = VendTable::find('‪‪‪PL00001');

    LogisticsElectronicAddress          logisticsElectronicAddress;

    container                           defaultRole = map2Con(LogisticsLocationEntity::getDefaultLocationRoleFromEntity(tableNum(DirPartyTable)));

 

 

    ttsBegin;

    logisticsElectronicAddress.Type = LogisticsElectronicAddressMethodType::Email;

    logisticsElectronicAddress.Locator = 'ramesh.balakrishnan@ao.com';

 

    logisticsElectronicAddress.Location = DirPartyLocation::findOrCreate(VendTable.Party, 0).Location;



    logisticsElectronicAddress = LogisticsElectronicAddress::findOrCreate(logisticsElectronicAddress);

 

    logisticsElectronicAddress = LogisticsElectronicAddress::findRecId(logisticsElectronicAddress.RecId, true);

 

    logisticsElectronicAddress.Description = "Official Email";

 

    logisticsElectronicAddress.IsPrimary = NoYes::Yes;

 

    logisticsElectronicAddress.update();



    LogisticsEntityLocationRoleMap::createEntityLocationRoles(tableNum(LogisticsElectronicAddressRole), logisticsElectronicAddress.RecId, conPeek(defaultRole, 1), true);

 

    info(strFmt("Created/updated phone number [%1] for customer %2.", logisticsElectronicAddress.Locator, VendTable.AccountNum));

    ttsCommit;

}

Tidak ada komentar:

Posting Komentar

Bottom Ad [Post Page]