For Part 1 chick here
Hi folks! I’m back with Part 2 of how to create custom approval workflow in Dynamics NAV. An overview of Part 1, we created an Event Publisher then we created function for sending approval then for approval, for reject and delegate. Part 2- Now we will continue with how to add these event functions to the library.
Microsoft Dynamics NAV 2017
2. In the Text constants, we add the texts.
3. In the RTC, navigate to the Workflow Event/Response combination, check the appropriate response for the events.
4. In the workflow Table Relation create a relation between Job table and approval entry table with the field the Record ID to approve.
5. Now to enable a workflow navigate to Departments/CRONUS International Ltd./Departments/Administration/Application Setup/Workflow
6. Click on Workflows then on New. This will create a new workflow design. Enter the workflow code, description and category.
7. Select your event ‘Approval of Job is requested’. This is the event added to the library. Add response to it.
8. In the next line select the next event, An approval request is approved and add response to it.
9. In workflows only the first event is primary the second event should be indented to it so for the events after the primary event we increase the event.
Now enable the workflow.
10. Now we need to set up the approver who will approve the request. Navigate to Approval User setup. Select the approver ID from the drop down and set the approver as approval administrator.
for more information of how to setup approval user setup refer https://chrisdsilvablog.wordpress.com/2017/10/25/approval-workflow-setup-and-process-in-microsoft-dynamics-nav-2017
11. In the response for the first event we use the approver type as workflow user group and set the username as a workflow user group approver
for more information about workflow user group refer https://chrisdsilvablog.wordpress.com/2017/11/06/approval-workflow-using-workflow-user-group-in-microsoft-dynamics-nav/
12. Now the setup for workflow is done, we can test it by navigating to jobs and clicking on send approval request button. The status changes to pending approval and request is sent to the approver via email
13. Email notification will be provided. To implement this you need to setup the SMTP email set up and provide the from email address.
for information how to setup Notification Email refer https://chrisdsilvablog.wordpress.com/2018/07/17/how-to-send-email-notification-to-users-using-workflow/
14. Navigate to sent notification entries in the search box and you can see the entry for the email sent.
15. Navigate to Approval Request Entries in the search box, we can view the sender ID and the status with date and time and Last modified by user. Here the approval Status is open as it is not approved by the approver.
16. Now you need to sign in as the approver and approve the request, so now I sign out of my account. The approver signs in the account and in NAV he navigates to Request to Approve.
17. The approver can either approve it or reject it. Open Record button opens the record and the approver can view the job document.
18. On click of approve, the record deletes and the document is approved.
19. Navigate to the Approval Request Entries, we can view the view the status.
20. Navigate to jobs and check the status. The status is changed to released.
Thanks for reading. Post your feedback in the comments section. You can also email me your queries from Contact Me https://chrisdsilvablog.wordpress.com/contact-me/