Skip to main content

Notifications

Workflow in Microsoft Dynamics 365 FO


Workflow in Microsoft Dynamics 365 FO is used to automate business processes. It defines how document/record is moved through the system, approvals on the record, and decisions required at each step.

So basically to understand we will take an example of a PO. Let’s just say I create a PO to buy 5 Laptops for my organization and the total cost of all the laptops is 10 lakh. and my Limit on the organizational level is limited at 5 lakh. so in workflow configuration as per a typical scenario, it will go to my manager whose limit is much greater than mine, then he will approve it or reject it depending on his decision. Configuration for workflow can be done from the front end, without any programming skills.


Workflow in Microsoft Dynamics 365 FO


How to create a custom workflow:

Step 1: Create an Enum which has the following enum.

Step 2: Drop this Enum in the table in which you want to apply the workflow, In my case I will be adding this enum in LSSCRFMainTable (this is a custom table) as shown below.

Step 3: Now write ‘canSubmitToWorkflow‘ method on the table.

Step 4: Now create another method ‘updateWorkflowStatus‘ on the table.

Step 5: Now create a form and put the data source as the above table, and create design and add controls in the design.

Step 6: Now create a display menu item for the form and set the Object type property and Object

Step 7: Add the display menu item in the menu so that the user can see the form in the front end. In my case.

Step 8: Now create an AOT query and add the data source.

Step 9: Now we will start with the Workflow Category creation. To create a workflow category we will add item from solution explorer. Now set the Label property and Module of the workflow category as shown below.

Step 10: Now add a workflow Type. To create a workflow type we will add item from Solution Explorer. Once you click ok a new window will open like below, just select your category, query and Document menu item. These items were created in the previous steps.

Step 11: Now we will create workflow approval, To create a workflow approval we will add an item from Solution Explorer. Once you click next a new dialog box will open like below.

Workflow document: This was that class that was automatically created while creating workflow type.

Document menu item: Menu item for the form that we created.

Step 12: Now open the Workflow type and add the workflow approval reference in the supported elements as shown below. Now for workflow type property Just update the label for workflow type and we are good to go

Step 13: Once all this is done, open the form on which you want to apply the workflow. Go to form design set the workflow data source, enable the workflow, and set the workflow type.

Step 14: Once all this is done, just build and synchronize your project area and we are good to go for front-end configuration.
Once this is created, it will create 3 classes and 2 action menu items.

Above was the overview of Workflow, Now for in-depth Workflow of front-end and back-end, you may follow Workflow in Microsoft Dynamics 365 FO

Thank you.


Comments