x++ code to find customer Contact Information in ax 2012

static void customerContactInformation(Args _args)
{
    CustTable   custTable;
    DirPartyTable dirPartyTable;
    LogisticsElectronicAddress  logisticsElectronicAddress;
   
   
    custTable = CustTable::find('‪‪‪13814');//give custAccount number
    dirPartyTable = DirPartyTable::findRec(custTable.Party,false,DirPartyType::None);
    logisticsElectronicAddress = LogisticsElectronicAddress::findRecId(dirPartyTable.PrimaryContactEmail);
   
   
    info(strFmt("Name: %1,EmailAddress: %2 ",dirPartyTable.Name,logisticsElectronicAddress.Locator));
     
     

}

Comments

Popular posts from this blog

x++ code to add hyperlink to a field in D365FO

x++ code to get Vendor Email Address based on Purpose in Dynamics 365 for Operations

x++ code to get Customer Address based on purpose in ax 2012