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

Thursday, August 13, 2020

Retrieval of Customer Address In AX 2012

Retrieval of Customer Address Using Select Statements.

Run this code in job

 public void Process(Args _args)

{

    CustTable                   custTable;

    DirPartyTable               dirPartyTable;

    LogisticsElectronicAddress  logistics;

    LogisticsPostalAddress      postalAddress;

    LogisticsLocation           location;

    select custTable where custTable.AccountNum == "US-017"

        join    dirPartyTable  where   custTable.Party == dirPartyTable.RecId

            join    location  where  Location.RecId == dirPartyTable.PrimaryAddressLocation

                join postalAddress where   postalAddress.Location == location.RecId;

    info(strFmt("%1 , %2, %3, %4 ",custTable.AccountNum, postalAddress.Address,              dirPartyTable.Name,custTable.name()));


}

No comments:

Post a Comment