web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Using Dynamic Fields from a custom entity in email templates

(0) ShareShare
ReportReport
Posted on by 274

Hi All,

I seem unable to add dynamic fields into an email template from a custom entity that I've created.

I set the email template to global but the option to select the entity wasn't in the drop down. I found a useful guide (https://community.dynamics.com/crm/b/passiondynamics/archive/2018/01/03/insert-dynamic-values-from-custom-entities-in-an-email-template-microsoft-dynamics-crm), but this doesn't seem to resolve the entity or field names.

Currently running:

Version 1710 (9.1.0.4832) online 

Any ideas will be much appreciated :)

Cheers

Sam

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Kokulan Profile Picture
    18,054 on at
    RE: Using Dynamic Fields from a custom entity in email templates

    Hi

    Please refer to my response on the following post

    community.dynamics.com/.../917633

  • Sam Conroy Profile Picture
    274 on at
    RE: Using Dynamic Fields from a custom entity in email templates

    Hi Kokulan,

    Sorry, I've been away. Thank you for the link, I'm just trying this now and will let you know.

    Sam.

  • Sam Conroy Profile Picture
    274 on at
    RE: Using Dynamic Fields from a custom entity in email templates

    Hi,

    I've tried this but the names still do not seem to resolve after they are manually added.

    I'm guessing I've missed a step somewhere?

    So I added in {new_entitycontactname.new_entity}, but it just displays in that format in the email rather than pulling the dynamic value.

    Thanks Sam

  • Kokulan Profile Picture
    18,054 on at
    RE: Using Dynamic Fields from a custom entity in email templates

    Please make sure you have followed all the steps I provided on page 1 and 2 of that link.

    Have you imported the following solution?

    github.com/.../dynamics-custom-emails

  • Sam Conroy Profile Picture
    274 on at
    RE: Using Dynamic Fields from a custom entity in email templates

    Ah, yes I missed the page. I'll go through it all now. I'm guessing the solution works fine on ver 9.1 ?

  • Kokulan Profile Picture
    18,054 on at
    RE: Using Dynamic Fields from a custom entity in email templates

    Yes, it works fine on 9.1.

    It does not have any dependencies to UI components or anything like that. It's just a Custom Workflow Activity that instantiates the email template and then replaces the placeholder with actual value.

  • Sam Conroy Profile Picture
    274 on at
    RE: Using Dynamic Fields from a custom entity in email templates

    Thank you for this, it's perfect and exactly what I needed!

  • Sam Conroy Profile Picture
    274 on at
    RE: Using Dynamic Fields from a custom entity in email templates

    When running the workflow I get an error suggesting it doesn't like my sending address.

    The log file shows the following error:

    Sync workflow 'Update Review Form to Closed' terminated with error 'Invalid Record Context URL 'sam@domain.com''.

    I know I can send from CRM normally but it just seems to have a problem here. Is there anything I've missed?

    In the settings for the sending address I have {Primary Email(Owning User (User))}. I've tried a few others as well but nothing seems to work and get basically the same error.

    Thanks

    Sam

  • Verified answer
    Kokulan Profile Picture
    18,054 on at
    RE: Using Dynamic Fields from a custom entity in email templates

    Hi Sam,

    Instead of the Primary Email, you will have to pass the Record Dynamic URL (of the user record) thats what the code is expecting.

  • Sam Conroy Profile Picture
    274 on at
    RE: Using Dynamic Fields from a custom entity in email templates

    Ah, I see what I did. The Sending Email Address field was correct, it was the recipient that I didn't add the Record URL. My fault for using the same address for the sending and contact, making me not realise what field was at fault in the error! Lesson learnt, and it is working perfectly now. Thank you loads!

    Sam

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans