How to Create custom workflow in D365 finance & Operations Project

How to Create custom workflow in D365 finance & Operations Project

Workflows are designed to streamline business processes while giving clear instructions for documents to flow, and for the users who need to approve it. Since there aren’t any existing workflows available for service agreements, creating a custom workflow for your D365 Finance and Operations Project is your best bet here.

This guide will explain every step needed to create your custom workflow in Dynamics 365.

Create Enum

The base enumeration is used to define the status of the workflow. Here are the steps needed to define it:

– Create a new Enum for the workflow status

Create A New Field on the Table

– Here, we use the table SMAAgreementTable as an example. Create an extension of the table and drag Enum to table.

Create Methods on the Table

Next, you will be required to create methods on the table using the following steps:

  • Create a new class and name it “devSMAAgreementTable_Extension”
  • Extend the table “SMAAgreementTable”.
  • Create methods with the following names
    • canSubmitToWorkflow
    • UpdateCustWorkflowState
  • The “canSubmitToWorkflow” method will use a chain of command for the next keyword.

Create a New Query

Creating a new query is easy:

  • Here we use the SMAAgreementTableListPage query

Create Workflow Category

  • Click on Add > New Item > Business Process and Workflow > Workflow Category
  • Enter a proper name
  • Set the properties as given below
    • Label = “Service agreement workflow category”
    • Module = Salesorder (as of now we will add workflow to AR. So, the workflow will list under the AR module)

Create Workflow Type

  • Create a new workflow type with the following steps:
    • Click on Add > New Item > Business Process and Workflow > Workflow Type

– Edit the devServiceAgreementWFTypeEventHandler class as given below

– Write the following code on the submit manager class

Create Workflow Approval

– To create a workflow approval, simply click on Add > New item > Business process and workflow > Workflow Approval

– Update the devServiceAgreementWFApprovalEventHandler eventhandler class

Add Workflow Approval to Workflow Type

– Create an approval supported element on workflow type under devServiceAgreementWFType > Supported elements

– Enable Workflow on Form

– Create Workflow

Wrapping Up

We hope that this tutorial on Creating Custom Workflow Activity Dynamics 365 was helpful and easy to follow. If you still have a few questions about the process, or any other questions relating to your D365 project, please feel free to contact our team of DEV IT experts today. They will help you get the best out of your development process in D365.

The following two tabs change content below.

Darshan Patel

Darshan Patel is a technical consultant working since 2011 on Dynamics AX, he has Functional & Technical experience in Microsoft Dynamics AX (ERP). He has worked on public and private sector projects.

Leave a Reply

Your email address will not be published.