How to update records in all legal entities when working with one of all legal entities...

Hi All,

I am using Ax2012, I have a requirement to do that I have 4 different legal entities and in each legal entity we have number of customers and we have a field (Legacy Id) on Customer Master, common in all four legal entity. so when am doing transaction in one company so I want to update a different field (Credit Limit) on Customer Master of the customers in all legal entities which has same legacy id in all companies.

I have a little bit about a concept of Cross Company but I don’t know more about it.

Please help me to outcome this problem.

Thanks & Regards

Vijay Raj Nath

Hi ,

Please follow the below code on cross company, may this will help u

BankAccountTable tabBAT; // saveDataPerCompany == true.
container conCompanies = [ ‘cm1’, ‘cm2’, ‘dat’ ];
str 4 sCompanyPrevious = " "; // Maximum length is 4 characters.
int iCountCompanies = 0;
while select
: conCompanies

  • from tabBAT
    order by dataAreaId
    if ( sCompanyPrevious != tabBAT.dataAreaId )
    info( tabBAT.dataAreaId + " = tabBAT.dataAreaId" );
    if ( iCountCompanies >= 2 )
    sCompanyPrevious = tabBAT.dataAreaId;

Thanks & Regards,


It’s already explained on MSDN: Cross-Company Data Modification Using X++ [AX 2012].