Tuesday, 28 November 2017

Batch job in AX7 / D365 x++ code

In AX7 / D365 batch jobs are created pretty same as we did in AX2012. Below mention is the code snippets that shows how to create a batch class.




After that all we need to do is to create Action menu item and assign class name in its object property and set Object type to Class. That is all you need to do for creating a batch job.

5 comments:

  1. Hi please help with this, EgxConstants does not recognize me in the if of the catch (Exception :: UpdateConflict)

    catch(Exception::Error)
    {
    throw error("@EdgeAXLabels:DemandAllocationBatchFailed");

    }
    catch(Exception::Deadlock)
    {
    retry;
    }
    catch(Exception::UpdateConflict)
    {
    if(appl.ttsLevel() == EgxConstants::Zero)
    {
    if(xSession::currentRetryCount()>=#RetryNum)
    {
    throw Exception::UpdateConflictNotRecovered;
    }
    else
    {
    retry;
    }
    }
    else
    {
    throw Exception::UpdateConflict;
    }
    }
    }

    ReplyDelete
    Replies
    1. Hi,

      EgxConstant is my constants string class which is use to show my labels. In your case you all need to do is to write 0 (Zero).

      Delete
    2. What does batchProcess.runOperations() do in Main & how & when does the customize code written under public void run () executes.

      Delete
    3. Hi,

      RunOperation() method executes the operation associated with the batch class also it executes Run() Method.

      Delete

Set up Online VM for Dynamics 365 Finance and Operation for Technical and Functional Learning Purposes

In this blog, I will discuss how we set up an online VM for D365F&O for Technical and Functional learning purposes for free. Step: 1 Cl...