Avoid Over layering in Development of Workflows on Existing Form


Workflow Extension (alternate way)



As we all know that over-layering is restricted by Microsoft in D365FO and in extension canSubmitToWorkflow not working at all.


Last week, I have received the requirement from my project manager to create a custom workflow on the Transfer order form. as I mentioned that over-layering is not allowed. After few hours of brainstorming within the team, we decided to create a custom workflow with the new table which we will use sort of extension and associate the table with the Transfer order form.

Following are the steps to create a custom workflow and associate it with the existing form.

Prerequisite.
Basic workflow knowledge required. 


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

Reference screenshot.


Step-2 Create a 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 a method in the table to update the 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 the workflow form of your module and click on new to create a new workflow.

You can check in the below screenshot my workflow is appearing.

Reference screenshot.



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

Step-14 Create an 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 the parent data source. in my case parent table was inventTransferTable.

Step-16 Only two types of joins are 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 table Methode OnWritten and insert the record on our newly added data source as well. Whenever users create or update the Transfer table.  In my case invent transfer table was a 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.





Please feel free to contact me if you are facing any issues during the implementation of this blog.

Support Faryal's Cusine


Mobile Workspace D365FO


Mobile Workspace D365FO 


In D365FO the mobile workspace is not so difficult to develop, in this article, I will show you, how you can create the mobile workspace by following few simple steps.



Step-1 navigate to the top left and click on the Gear icon. a drop-down popup will appear like below. 



Step-2 Then click on Mobile App once window will appear like below then click on create.



Step-3 fill the required fields. 


Step-4 Click on Add page icon and enter the page name and description. Now navigate to the page which you are targeting to show on the mobile workspace. In our case, we are on the Release Product form page.




Step-5 Now click on select fields. 
Step-6 All the fields will be highlighted like the below screenshot. You can click on the + icon to add fields to the list of the page.




Step-7 Now click on List control and select properties.

Step-8 Below popup will appear, You can change the labels and style of a page from here.
Step-9 If you want to add a detail page then click on the add page icon else click on done after the required change. In our case, we are adding a detail page of the items. 


Step-10 Enter the new page name and open items detail view to add fields in the detail page.


Step-11 after selection of the fields.. click on list control and add action. You can find the Add action button in the Action tab of the page. 



Step-12 Enter Action Name and click on OK... Then back to the previous page again. there is no need to add any fields in actions.


Step-13 Now click on done and then save.



Step-14 Navigate to the mobile app screen again to verify your mobile work-space.
Step-15 select your mobile workspace and click on publish.


Please feel free to contact me if you are facing any issues during the implementation of the above blog.




Support Faryal's Cusine


Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...