Monday, June 8, 2020

Deep links in Workflow Email Notifications in Dynamics 365 for Finance and Operations

When using workflows in Dynamics 365 for Finance and Operations, you can enable email notifications. This means that each time when a workflow notification is sent, an email is delivered as well. Which email and to whom is specified within a particular workflow.
Let’s say that you want to use a deep link within a workflow notification email. Currently, you can achieve that by inserting the %Workflow.Link to web% placeholder in the notification text as shown on the pictures below.
   
We should set up an Email template to be used with the Purchase order confirmation workflow in the following way:
Note that we are using the Improved Email Templates functionality which ships with Docentric AX Free EditionLearn more about Improved Email Templates >>
Because we used the %Workflow.Link to web% placeholder in the notification message, we will get the proper deep link to the purchase order that needs to be confirmed in the email message as well:
Unfortunately, we will also get the same and not so nice link in the WF confirmation dropdown form:

The %ENTITYURL% deep link enabled in Email templates

To avoid this behavior, we introduced (from the 3.2.7 version on) a new class for placeholders: DocEmailTemplateAdvancedHandlerWFAL, which can be used for workflows and alerts. This new class brings a new placeholder: %ENTITYURL%:
   
Thus, we don’t have to use the %Workflow.Link to web% placeholder in the notification text within the workflow itself anymore, spoiling the look of the confirmation form for Purchase order. We can use the %ENTITYURL% deep link provided in Email templates instead.