Saturday, 7 March 2020

Standards Form Workflow Submit to Workflow COC Issue Solution

Step-1 Create custom Enum or you can use existing.

Reference screenshot.

Step-2 Create custom table and add two fields Transfer order Id and Status field extend both fields with appropriate Enum or EDTs. In our case Table name is SLD_TransferOrderWorkflow

Reference screenshot.

Step-3 Create relation on Invent Transfer table and our newly created table on the basis of Transfer Order Number.

Reference screenshot.


Step-4 Create Custom Query and Add the SLD_TransferOrderWorkflow table.
Step-5 Create workflow Type.  

Reference screenshot.

Step-6 Create workflow Approval.

Reference screenshot.

Step-7 Drag the workflow approval in workflow type.

Reference screenshot.
Step-8 Override the canSubmitToWorkflow  on SLD_TransferOrderWorkflow.

Reference screenshot.

Step-9 Create method in the table to update status on workflow events/approval.

Reference screenshot.


Step-10 Place proper labels on workflow types, approval and menu items.

Step-11 Build the model and perform the database sync.

Step-12 Now navigate to workflow form of your module and click on new to create new workflow.

You can check in the below screen shot my workflow is appearing.

Reference screenshot.


Step-13 configure workflow as per your requirement and activate.

Step-14 Create extension of the form on which you want to associate workflow. in my case form was inventTransferTable.

Step-15 Add data source table and join with parent data source. in my case parent table was inventTransferTable.

Step-16 Only two type of join supported. Inner and outer.. in my case i am using inner because i don't have previous records.  but recommend outer join if you have previous records.

Reference screenshot.

Step-17 Now override the initialized method of the newly added (SLD_TransferOrderWorkflow)  data-source  and enable the workflow.

Reference screenshot.

Step-18 Now override the parent tabl Methode OnWritten and insert the record on our newly added data-source as well. Whenever user create or update Transfer table.  In my case invent transfer table was parent.

Reference screenshot.


 Step-19 Now build the model and create the new transfer order and verify. for me its working fine without over-layering.

Reference screenshot.


No comments:

Post a Comment

POSTMAN D365

  Postman is useful to test the behavior of different OData class from/to D365FO. In this post we will see the steps to setup Postman with D...