Retrieve Name,Address,email for a selected customer in ax2012

  We are going to retrive Name, address and email id for a particuler customer

jus add below select statement to retrive the Customer.

static void Customer(Args _args)

{

   CustTable                    custtable;

   DirPartyTable                dirPartyTable;

   LogisticsPostalAddress       logisticsPostalAddress;

   LogisticsLocation            logisticsLocation;

   LogisticsElectronicAddress   logisticsElectronicAddress;


   while  select custtable

       where custtable.AccountNum == 'DE-001'

        join dirPartyTable

            where dirPartyTable.RecId == custtable.Party

       join logisticsPostalAddress

            where  logisticsPostalAddress.Location == dirPartyTable.PrimaryAddressLocation

// we can use below logisticslocation table also for fetching the records

       //join logisticsLocation

            //where logisticsLocation.RecId==dirPartyTable.PrimaryAddressLocation

       

       ////join logisticsElectronicAddress

            ////where logisticsLocation.RecId==logisticsElectronicAddress.Location


       join logisticsElectronicAddress

          where logisticsElectronicAddress.RecId == dirPartyTable.PrimaryContactEmail

    {

   info(strFmt("%1/--/%2/---/_%3/----/_%4",custtable.AccountNum,dirPartyTable.Name,logisticsPostalAddress.Address,logisticsElectronicAddress.Locator));


    }


    //==================================================================


}

Done /-\

No comments:

Post a Comment