D365FO Batch Job retries

 

Enable automatic retries on batch jobs


In the April/May released, Microsoft introduces the feature to retry the batch job, In the past, if the Finance and Operations apps experience any kind of loss of connection to Microsoft SQL Server, then all batch jobs that are running fail, and the reason is, on Azure if the connection is lost then the recovery is almost impossible.

So, Microsoft introduces an Interface class that will batch to reset itself in case of connection loss or failure.

How you can implement it in your code?

Here is an example if you are using the "RunBaseBatch" class in your batch Job.

class TestBatchJob extends RunBaseBatch implements BatchRetryable

{

    [Wrappable(true), Replaceable(true)] // Change to meet your customizability requirements

    public boolean isRetryable() // Use final if you want to prevent overriding

    {

        return true; 

    }

}

 Here is an example if you are using the "SysOperationServiceController" class in your batch Job.

class TestBatchJob extends SysOperationServiceController implements BatchRetryable

{

    [Wrappable(true), Replaceable(true)] // Change to meet your customizability requirements

    public boolean isRetryable() // Use final if you want to prevent overriding

    {

        return true;

    }

}


Important

If you designing a multithreading job and adding the runtime task, then you should implement this interface on both the main controller and the task controller.


If you want to disable the retry of the batch job then add your class in the 

Batch class configuration overrides 


Overrides setup


Support Faryal's Cusine


Active batch periods

 


Reference link

 It was the most demanding requirement from almost every client that they want to execute some XYZ batch after some X number of hours but only after office hours. As we all know this feature was not available in any previous version of AX/D365FO. But with the release of Platform update 21, an additional level of control over when batch jobs screen is now available. 

Scenario covered:

You can configure the hourly Batch job 7 days a week, and can strict the job to execute only the given time window.

Scenario not covered:

You want to configure the hourly Batch job 7 days a week, But you want to execute the job for entire days on weekends or holidays.

Instruction to implement the feature

Go to System administration > Setup > Active periods for batch jobs.

References screenshot



Enter the name of the batch period group, and specify the start and end dates time that the batch job will be active, and save the records.

References screenshot


now go
 to System administration > Inquiries > Batch jobs and find your targeted batch job.

References screenshot


Find the active period column, click on edit and 
select the active period that you want to assign, and then click Save.

References screenshot









Support Faryal's Cusine


Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...