Notifications
Announcements
No record found.
Hi all
I have an AOT job that updates records in ProjForecast. Can I process this job in batch?
*This post is locked for comments
Yes
I couldn't find out how to do it. Will you please describe how to do it?
Sure, but i need a little more information from you.
What excactly are you trying to run, it is an AX Job or a Class?
If its a job then the quick answer is move your code to a class, you can run a job in batch but only by creating a class that runs the job, and that a little cumbersome.
It its a class, then make it extend SysOperation Framework, then you can run the class in batch.
Hi Rudi
I have both class and an AOT Job. I dont know which one will be easiest to develop.
My class:
class NCUpdate_ProjForecast { }
[SysEntryPointAttribute(false)] public void processRecords() { ProjForecastCost projForeCastCost; //Determines the runtime if (xSession::isCLRSession()) { info('Running in a CLR session.'); } else { info('Running in an interpreter session.'); //Determines the tier if (isRunningOnServer()) { info('Running on the AOS.'); } else { info('Running on the Client.'); } } while select forUpdate projForeCastCost { ttsBegin; //Do something projForeCastCost.update(); ttsCommit; } }
Then I created an Action MenuItem:
when I run it, the batchjob gets created, but I get the following error.
You need use the class, and make it run in the SysOperation Framework.
I will try to have a look at it during the day today.
Hai Mahyar,
Look at the Class Tutorial_RunbaseBatch It is the Standard Example for Batch Processing.
See this Class, Duplicate this Class Make some Changes in this Class according to your Scenario.
It is Working for me.
Mahyar,
It seems to me that you are missing to do a CIL compilation. I can reproduce your error before doing CIL, but not after.
When the job is executed in batch, it is the CIL version of the code that gets executed.
Hi Mahyer,
Extend your class to "RunBaseBatch" and after adding the code to "Run" Method of the class, compile your code and then after compilation do an "Incremental CIL".
Best Regards
Shah
Also add your logic in the "Run" method of the Extended Class.
Bests
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2