SBX - Search With Button

SBX - Forum Post Title

Using Dynamic Fields from a custom entity in email templates

Microsoft Dynamics CRM Forum

Sam Conroy asked a question on 20 May 2019 10:57 AM

Question Status

Verified

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

Reply
Verified Answer

Hi

Please refer to my response on the following post

community.dynamics.com/.../917633

Reply
Sam Conroy responded on 30 May 2019 9:43 AM

Hi Kokulan,

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

Sam.

Reply
Sam Conroy responded on 30 May 2019 10:19 AM

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

Reply

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

Reply
Sam Conroy responded on 31 May 2019 8:44 AM

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

Reply

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.

Reply
Sam Conroy responded on 3 Jun 2019 7:53 AM

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

Reply
Sam Conroy responded on 6 Jun 2019 6:43 AM

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

Reply
Verified Answer

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.

Reply
Sam Conroy responded on 6 Jun 2019 12:17 PM

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

Reply
Verified Answer

Hi

Please refer to my response on the following post

community.dynamics.com/.../917633

Reply
Verified Answer

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.

Reply

SBX - Two Col Forum

SBX - Migrated JS