Monday 7 May 2018

Get Customer Address in Ax 2012

static void Na_CustAddress(Args _args)
{
    CustTable                   custTable;
    DirPartyTable               dirPartyTable;
    LogisticsElectronicAddress  logistics;
    LogisticsPostalAddress      postalAddress;
    LogisticsLocation           location;

    //using select statements

    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