Posts

Create a Simple Approval Workflow in Microsoft Dynamics D365

Image
Step 1: Basing on the requirement create a new base enum or use the existing base enum Step 2:           Create new fields to your main table – Ex:  SMJ_PurchaseOrder •        Status – Enum Type -  SMJ_Workflow •        SubmittedBy – Edt  –  UserId •        SubmittedDateTime – Edt  –  DateSubmitted Set the properties for the above 3 fields  AllowEditOnCreate – No AllowEdit – No   Step 3: Add table level methods 1.                     Override the Method in the Main table– canSubmitToWorkflow 2.                     Create a new method (Not overridden method) in the main table as below. Below is the code: Override the Method in the Main table– canSubmitToWorkflow /// <returns></returns>     public boolean canSubmitToWorkflow( str _workflowType = '' )     {         boolean ret;         SMJ_PurchaseOrder     SMJ_PurchaseOrder;         select firstOnly SMJ_PurchaseOrder where SMJ_PurchaseOrder.P