Get Customer, Vendor& Company Addresses in AX 2012

 Get Customer,  Vendor& Company Addresses in AX 2012

//Get Customer/Vendor Address by Id & Current Comapny Address
//By replacing the CustTable with the VendTable we will get the address of Vendor
static void Job85(Args _args)
{
    CustTable custTable;
    str       description,address,completeaddress;
    
    custTable = CustTable::find('L0115');
          
    description = DirParty::primaryPostalAddress(custTable.Party).displayLocationDescription();
    
    address = DirParty::primaryPostalAddress(custTable.Party).Address;
    
    completeaddress = strFmt("%1,%2",description,address);
    info(strFmt("%1",completeaddress));
    
    //Get the Current Company Address
    info(strFmt("%1,%2",curext(),LogisticsPostalAddress::findByLocation(CompanyInfo::find().postalAddress().Location).Address));
    
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s