Thursday, January 23, 2020

How to create a batch job for Runbase Class using x++ in D365 FO

Hi all ,

Either we can manually create the record in Batch Job Master in System Administration Module or we can create the same directly using x++.

Please view the code below written in a Runnable Class :-


    public static void main(Args _args)
    {
        BatchHeader                batHeader;
        BatchInfo                     batInfo;
        RunBaseBatch             rbbTask;
     
        str sParmCaption = "Free Text Invoice Creation Batch Job";

        rbbTask = new FreeTextInvoiceCreationBatchJob();
        batInfo = rbbTask .batchInfo();
        batInfo.parmCaption(sParmCaption);
        batInfo.parmGroupId("");
        batHeader = BatchHeader::construct();
        batHeader.addTask(rbbTask);
        batHeader.save();
        info(strFmt("%1 batch has been scheduled.", sParmCaption));
    }

    Happy Coding !!!

3 comments:

  1. Wow, this is really interesting reading. I am glad I found this and got to read it. Great job on this content. I like it. visit blog

    ReplyDelete
  2. Solo this class is somewhat precarious to use as your principle abilities are creating enormous danger to get the adversary to assault you. Best Assignment Help Online

    ReplyDelete

How to reverse Free Text Invoice Voucher entries without Dialog

 Hey Folks ,  This blog post is in continuation of the previous post for Reversing Free Text Invoice Voucher entries with Dialog. Only diffe...