Create a Batch Job in D365 AX and Create new Batch Job Alert

Hi

Create a Batch Job in D365 AX and Create new Batch Job Alert


Step 1: Create new class which extends RunBaseBatch to run as Batch Task in Batch Job.

public class TestBatchClass extends RunBaseBatch
{
    public void run()
    {
           
        //    //Code to execute
                  info(strFmt("Hello from Batch Demo Class .run at %1",DateTimeUtil ::toStr(          DateTimeUtil ::utcNow())
           ));
    }

    public container pack()
    {
        return conNull();
    }

    public boolean unpack(container packedClass)
    {
        return true;
    }

    public ClassDescription caption()
    {
        return 'Fetch Data';
    }

}

Step 2:  Assign Batch Server for Batch Group

Go to System Admin --> Batch Group




Step 3: Create a Batch Job

Batch Status
Withhold – batch will not be picked up for execution, batches need to be in this status to edit
Waiting – batch will be picked up for execution at next recurrance schedule
Executing – batch is currently being executed
Ended – batch processes successfully

Tabs in Batch Job
View Tasks – shows the individual tasks of the batch
Batch Job History – shows status of previous executions of the batch
Recurrence – set up the schedule to execute the batch
Alerts – set up alerts for different events of the batch
Change Status – changes the status of the batch


Go to System Administration -> Batch Jobs --> New

Click on View Tasks and Create a new Task and assign batch job which is created in Step 1 TestBatchClass 

Change Status and set Recurrence if its required



And Check Histoy in Batch Job History


Finally make sure Batch Management Service is running on Azure VM




References

https://alexdmeyer.com/2017/01/30/batch-jobs-in-dynamics-365-for-operations/
http://www.atomicax.com/content/create-batch-executable-class
https://msdn.microsoft.com/en-us/library/cc636647.aspx
https://technet.microsoft.com/en-us/library/gg213151.aspx
http://mandruchow.blogspot.ae/2017/01/batch-jobs-in-dynamics-365.html
https://ax.docentric.com/make-form-batchable-dynamics-365-finance-operations/


Create new Batch Job Alert



1. Navigate to System Administration --> Inquiries --> Batch Jobs 

2. Select a corresponding Batch Job for failure email alert

3. Click on Tab BATCH JOB

4. Click Alerts

5. Make Select Yes in Error and Email (Email Id comes from users account in email id)


6. Click Ok to start getting email alerts if any failure in Batch Job

Comments

Post a Comment