DYNAMICS 365 INSERT CUSTOM ENTITY FIELDS IN EMAIL TEMPLATE

Working with Email Templates is very common and saves a lot of time especially if you have similar emails to send from CRM.

The email templates are by default provided for some built-in entities that are listed when you create the template; however, when working with custom entities, it is not straight-forward and you have to do some additional work to make it done.
Email template 1

To show you how to add custom entity fields in Email template content, I will create a new custom entity named Project and I will use some fields in order to build the email content
  1. In CRM Settings > Templates > Email Templates, create a new template and choose Global for Template Type
  2. In the Template screen, enter the Title of the template and the Subject of the email that will be sent
  3. To build the email content, I need the Customer name (lookup), Project name (text), Budget (currency), and Estimated Delivery Date (date time)
  4. To do so, you have to use the following format in order to resolve the values of the needed fields: {!EntityLogicalName:FieldLogicalName;}
    For my example:
    • Customer Name (lookup): {!new_project:new_customerid/@name;}
    • Project name (text): {!new_project:new_name;}
    • Budget (currency): {!new_project:new_budget;}
    • Estimated Delivery Date (Date Time): {!new_project:new_estimateddeliverydate/@date;}
    Email template 2

  5. Click Save and you will notice that the dynamic values will be resolved displayed in yellow
    Email template 3

  6. Let's test it by creating a new workflow and sending an email when a new project record is created
    Email template 4

    Email template 5

  7. Create a new project record and check the Activities. As expected, the correct values of the project record will be properly displayed in the email content
    Email template 6

Bonus Tips:
  • You can also use the template directly from the email activity screen by clicking Insert Template
  • To display option set values: {!EntityLogicalName:FieldLogicalName/@name;}
  • To display Date values: {!EntityLogicalName:FieldLogicalName/@date;}
  • To display Time values: {!EntityLogicalName:FieldLogicalName/@time;}
  • To display default text value: {!EntityLogicalName:FieldLogicalName; Default text}
  • Use the button Insert/Update in the template to choose fields from the user entity only


Hope This Helps!

Comments

Popular posts from this blog

DYNAMICS 365 HOW TO HIDE RECENT RECORDS FOR LOOKUP FIELD IN UCI

SEARCH BY GUID IN DYNAMICS 365

SAVE FORM IN DYNAMICS 365 JAVASCRIPT