How to get current company tax information and address detail in ax 2012

Description:

Here I have create demo job for getting current company tax information and address details in dynamics Ax 2012.

static void CompayInfo(Args _args)
{
    info(strFmt("COMPANY NAME-%1",DirPartyTable::findRec(CompanyInfo::Find().recid).Name));
    
    info(strFmt("ZIPCODE-%1",LogisticsPostalAddress::findByLocation(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryAddressLocation).ZipCode));
    info(strFmt("STREET-%1",LogisticsPostalAddress::findByLocation(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryAddressLocation).Street));
    info(strFmt("CITY-%1",LogisticsPostalAddress::findByLocation(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryAddressLocation).City));
    info(strFmt("STATE-%1",LogisticsPostalAddress::findByLocation(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryAddressLocation).State));
    info(strFmt("COUNTRYREGIONID-%1",LogisticsPostalAddress::findByLocation(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryAddressLocation).CountryRegionId));
    info(strFmt("PHONENO-%1",LogisticsElectronicAddress::findRecId(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryContactPhone).Locator));
    info(strFmt("EMAIL-%1",LogisticsElectronicAddress::findRecId(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryContactEmail).Locator));
    info(strFmt("FAX-%1",LogisticsElectronicAddress::findRecId(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryContactFax).Locator));    
    
    info(strFmt("GSTIN - %1",TaxRegistrationNumbers_IN::find(TaxInformation_IN::findDefaultbyLocation(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryAddressLocation).GSTIN).RegistrationNumber));
    info(strFmt("PAN - %1",substr(TaxRegistrationNumbers_IN::find(TaxInformation_IN::findDefaultbyLocation(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryAddressLocation).GSTIN).RegistrationNumber,3,strLen(TaxRegistrationNumbers_IN::find(TaxInformation_IN::findDefaultbyLocation(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryAddressLocation).GSTIN).RegistrationNumber)-5)));
    info(strFmt("VAT-%1",TaxRegistrationNumbers_IN::find(TaxInformation_IN::findDefaultbyLocation(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryAddressLocation).TIN).RegistrationNumber));
    info(strFmt("CST-%1",TaxRegistrationNumbers_IN::find(TaxInformation_IN::findDefaultbyLocation(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryAddressLocation).SalesTaxRegistrationNumber).RegistrationNumber));
    info(strFmt("ECC-%1",TaxRegistrationNumbers_IN::find(TaxInformation_IN::findDefaultbyLocation(DirPartyTable::findRec(CompanyInfo::Find().recid).PrimaryAddressLocation).ManECCRegistrationNumberTable).RegistrationNumber));
    info(strFmt("CIN-%1",CompanyInfo::Find().CoRegNum)); 
}

Related Posts

Previous
Next Post »

Thanks for comments.....