Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

RE: changecompany not changing the company please see the below code

$
0
0

Initially test in a job to know whether you are getting the data or not.

You need to reset the table buffer while using Changecompany() otherwise result will be too heavy as the buffer contains old data as well.

while select contractCompany
{
nameOfCompany = null; // reset the table buffer 
if (contractCompany.dataAreaId == '003')
{
changecompany(contractCompany.CompanyCode)
{
nameOfCompany = CompanyInfo::name();
}
}
if (contractCompany.dataAreaId == '014')
{
changecompany(contractCompany.CompanyCode)
{
nameOfCompany = CompanyInfo::name();
}
}
info(nameOfCompany.FieldName);// display the msg to test
}


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>