TITLE:
How to enable “Conditions” for Retail jobs in AX 2012 R2
DESCRIPTION:
We want to enable the possibility to schedule the Retail jobs (A-Jobs, N-Jobs or P-Jobs),
so they are running after each other. In this example it will be the A-jobs (A-1000 and A-1010)
- First we need to add the code enabling the class to be selected in the batch setup
\Classes\RetailConnScheduleRunner\classDeclaration
/// <summary>
/// Batch job to run the specified schedule
/// </summary>
///MS START
[SysOperationJournaledParametersAttribute(true)]
///MS END
class RetailConnScheduleRunner extends
RunBaseBatch
{
RetailConnSchedule schedule;
boolean
forceRun;
BatchHeader
batchHeader;
RefRecId
onlyTargetLocation;
#define.CurrentVersion(2)
#localmacro.CurrentList
schedule,
forceRun,
onlyTargetLocation
#endmacro
}
- Next you need to compile forward on the changed class
- Third is that you need to generate Incremental CIL
- The next step is now to create the batch jobs. The easiest is to go to the Retail Distribution schedule and then just
“Create batch job” on the A-1000
- After this step, we need to go to the System Administration / Inquiries / Batch jobs / Batch Jobs
- Find the A-1000 and set it to Withhold status
- Go to Batch Tasks
- Add a new line and type A-1010 in the Task Description. (the exact naming is important here). Find the RetailConnScheduleRunner in the lookup.
- Condition: After all tasks are created, go to the Condition area and add a new line and point to the job, you want
to be have finished before this can start.
AUTHOR:
Kim Truelsen
PUBLISHED DATE:
3rd July 2013