I have a cross-company property ("Yes") enabled query.,even though query returns values for the current company in Dynamics 365 (AX7)
I even tried with changecompany()
but there is no data for any other companies apart from current company.
_query.allowCrossCompany(true);
qr=new QueryRun(_query);
while(qr.next())
{
companyInfo =qr.get(tableNum(CompanyInfo));
info(strfmt("%1",companyInfo .DataArea));
}
here query is cross company query but still it showing the values for current company only(ie, if I run this code from USA dataarea shows only USA not other companies)
First,
CompanyInfo
isSaveDataPerCompany = No
, so cross company serves no purpose.Second, you must not be providing all of your code, because I just created/tried both of these jobs and they worked fine for
crossCompany
. Job12 is the one similar to what you did, but it still works.