hljs.configure({cssSelector: "code"}); hljs.highlightAll();

Wednesday, January 27, 2021

X++ Code to Retrieve Customer Contact information in AX/D365Fo

 

static void Getcontact(Args _args)

{

    CustTable                   custTable;

    DirPartyLocation            dirPartyLocation;

    LogisticsElectronicAddress  logisticsElectronicAddress;

    select firstOnly * from custTable

        where custTable.AccountNum == 'us-002'

    join dirPartyLocation

        where custTable.Party == dirPartyLocation.Party

    join logisticsElectronicAddress

        where logisticsElectronicAddress.Location == dirPartyLocation.Location

    && logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Phone;

    info(strFmt("Customer: %1, PostalAddress: %2",  custTable.AccountNum,                                                   logisticsElectronicAddress.Locator));


}

No comments:

Post a Comment