web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

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

Vishals786 Profile Picture Vishals786
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 !!!


This was originally posted here.

Comments

*This post is locked for comments