Skip to content
Dynamics 365 Blog

One of the task that workflow proves very handy is in sending email reminders when tasks are due. To improve the user experience it will be great if we can send the link to the crm entity instance that is due in the email so that users can select the link and go directly to the entity instance and start working on it.


You will have to do the following to enable this functionality.



  1. Create a small custom assembly that concatenates a string and GUID.

  2. Register the assembly in workflow config file.

  3. Create a workflow rule to send email reminders.

  4. Activate the workflow rule and you are good to go.


Step 1: Creating the custom assembly.


public string ConstructLink(string baseUrl, Guid objectId)


      {


            return baseUrl + objectId.ToString(“B”);


      }


Compile the funtion to an assembly file. Say workflowtestassembly.dll and let the class name be HelloType.


Step 2: Register the custom assembly in file workflow.config.


<method name=”ConstructLink” assembly=”workflowtestassembly.dll” typename=”HelloType” methodname=”ConstructLink” group=”Link”>


      <parameter name=”baseUrl” datatype=”string”/>


      <parameter name=”objectId” datatype=”lookup” entityname=”task”/>


<result datatype=”string”/>


      </method>


Step 3: Create a workflow rule.


When Task is created


Wait for 30 min before Task.Due date


ConstructLink: TaskLink


Email To:[owner] Subject: Task is due.


Note: in the custom assembly action Construct link we pass the baseUrl for the task detail page. I.e. http://MyServer/activities/task/edit.aspx?id={D02787BE-6E31-DB11-95BE-0013720EC2DB}


Use the return value of the assembly within the email body via slugs. On the right to the email body on the email form in workflow manager you will see the slug button.


You can write text like.


“ Your task with subject: {!Task.Subject:} is due on {!Task.Due date:} . click the following link to look and update it. Link {!TaskLink:} “


Step 4:  Activate the workflow rule and test it out.


Shashi Ranjan

We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!