Posts

Showing posts with the label crossCompany

crossCompany and changeCompany in AX 2012

Image
Hi Folks, Today, in this article we will understand the use of crossCompany and changeCompany in AX 2012. Let's start... crossCompany : You can fetch the data from tables across companies using crossCompany keyword in X++ select queries. Suppose you have a requirement to get the data from multiple companies in AX 2012 using X++ then in this scenario we can use crossCompany. You can also use containers to fetch data from subset of companies. For example: public void TestCrossCompanyUse() {     CustTable       custTable;     container       desiredCompanies = ['A', 'B']; // A and B are companies name     int             iCountCompanies  = 0;       while select crossCompany : desiredCompanies * from custTable     {         info(strFmt("%1, %2", custTable.AccountNum, custTable.dataAreaId));     ...