To add job into 'Batch job' using X++ code, just skip the .prompt() method.
All you need is:
- A class that extends RunBaseBatch
- A method that add the job into batch job
Eg.
classdeclaration SendBatchJob extends RunBaseBatch
{
....
....
}
//The method that calls to add the job
static void addBatchJob()
{
SendBatchJob sendBatch;
;
sendBatch = new SendBatchJob();
sendBatch.sendToBatch();
}
;
sendBatch = new SendBatchJob();
sendBatch.sendToBatch();
}
//The method that actually add the job into 'Batch job'
void sendToBatch()
{
this.batchInfo(); //InitializebatchInfo.parmBatchExecute(NoYes::Yes);
batchInfo.doBatch();
}
No comments:
Post a Comment