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


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;
}

Install and Configure Zpl Printer on D365 F&O

  Setup Zpl Printer On D365 F&O Posted on Recently, I have had an opportunity review the possibilities to print license plates within D3...