My 2p about ERP Solutions, Information Worker Solutions and other software products (mainly Microsoft Dynamics AX and Microsoft SharePoint).

10 October 2012

Create batch job through X++ code

by Patrik Luca 4 comments


Business requirement

Some flow should execute some code in batch, so you need to add a batch job for the corresponding RunBaseBatch class.


public static void scheduleBatch()
BatchHeader batchHeader;
BatchInfo localBatchInfo;
YourRunBaseBatchClass yourRunBaseBatchClass;
SysRecurrenceData sysRecurrenceData =

yourRunBaseBatchClass =

// retry 3 times
sysRecurrenceData =
sysRecurrenceData, 3);
// retry after 1 minute
sysRecurrenceData =
SysRecurrenceUnit::Minute, 1);

localBatchInfo = yourRunBaseBatchClass.batchinfo();
batchHeader = batchHeader::construct();

Comments 4 comments
Le3jeb said...

Thank you for sharing this with us. This article really helped me.

Anonymous said...

Hi Patrik
Thanks for sharing!
I have a question for you.

I want to calculate a configured item when sales order created, then configure the line, i put the cost calculation in a batch job, and without any user interface. I tried your job, and it seems that the calculation has not been done. i use the class BOMCalcJob_Item to do the calculation. can you show me how to run this by x++?
Thanks in advance!


Anonymous said...

I am not sure where you're getting your info, but good topic.
I needs to slend some time learning much more or
understanding more. Thanks for fantastic info
I was looking for this information for my mission.

Marina said...

Here is a detailed tutorial on how to add support for batch processing to an existing form in Dynamics 365 for Finance and Operations:

Patrik Luca, Ieper, BELGIUM
Feel free to use or spread all of the content on my blog. In return, linking back to my blog would be greatly appreciated. All my posts and articles are provided "AS IS" with no warranties.

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Most Read Entries

Subscribe feeds rss Recent Entries


Recommended Books

Subscribe feeds rss Recent Comments

This Blog is part of the U Comment I Follow movement in blogosphere. Means the comment field of this blog is made DOFOLLOW. Spam wont be tolerated.

Blog Archive

My Blog List