Quantcast
Channel: AX Developer Forum
Viewing all articles
Browse latest Browse all 9880

ChangeCompany not working in Batch Job

$
0
0

Hello,

I have a job that deletes log records.  If the job is ran in non-batch mode then it works fine.  When the job is ran in batch mode it only deletes records for one company.  What could be causing this?  Here is a sample of the code:

 

 

 

whileselectcrossCompany DataAreaId

            from xtraIntegrationAssetMMRLogCalls_Company

               groupby DataAreaId

               where xtraIntegrationAssetMMRLogCalls_Company.createdDateTime <= dateTimeCriteria

         {

 

              changeCompany(xtraIntegrationAssetMMRLogCalls_Company.dataAreaId)

              {

                  xtraIntegrationAssetMMRLogCalls = null;     // SCJ Issue 871 872 2013-12-19

                  delete_from xtraIntegrationAssetMMRLogCalls

                  indexhint DateTimeIdx

                  where xtraIntegrationAssetMMRLogCalls.createdDateTime <= dateTimeCriteria;

             }

         }

 

 

 


Viewing all articles
Browse latest Browse all 9880

Trending Articles