if you work with email templates; you might have to create a template which is to be sent from a custom entity & hence you will need field values from that entity.
Now out of the box – CRM doesn’t provide you an option to populate the field values from a custom entity.
So lets dig in and understand ; how this can be done.
1.Go to Templates from CRM settings and click on email templates ; click on “new” & in the popup select template as “Global”:
now if you notice – CRM gives you templates for individual entities as well but since we need one for custom entity – we will have to select global.
2. In the Template form, fill subject & Title.
3.In this example – i have a custom entity Loan, i would like to send email from this entity using an email template with Loan amount and customer populated. Customer is a lookup so lets do it.
Standard format is : {!EntityLogicalName:FieldLogicalName;}
for lookup values ; you would want to retrieve the name so you have to do it like below :
4. Hit save and it will be resolved:
5. now lets retrieve the loan amount which is a currency field:
6. Hit save and see the how this resolves as well:
if you have noticed – i have also inserted the current user name from out of the box feature “insert/update” from top button.
Similarly, you can do this with other fields like below :
single line of text : {!EntityLogicalName: FieldLogicalName; Default Text}
Date : {!new_loan:new_approvaldate/@date;}
Time : {!new_loan:new_approvaldate/@time;}
Lookup : as we did above
Optionset : {!new_loan:new_loantype/@name;}
7. Now lets see our template in action ; i will go the loan entity record and insert a template:
Yay! it worked like a charm.
so , that is how it is done. Let me know if you face any difficulties.
Cheers!!
Hi Rawish!
This is awesome and it works fine for me… except when the email is automatically sent via a workflow… in that case the dynamic values are just blank. Any ideas on this? It would be really helpful!
LikeLiked by 1 person
Hi Joana,
Thanks for your comment. I will check this approach and let you know how it goes.
LikeLike
Hi Rawish,
I’m having the same issue with Joana. Did you find anything with this?
Thank you in advance!
LikeLike
Hi Rawish,
I’m having the same issue with Joana. Did you find anything with this?
Thank you in advance!
LikeLike
Hi Rawish,
I’m having the same issue with Joana. Did you find anything with this?
Thank you in advance!
LikeLike
Hi did you find anything on this approach?
LikeLike
Can we add attributes from custom entities into a marketing email template?
LikeLike
Awesome Rawish! just what i wanted ! Many thanks
LikeLiked by 1 person
Thanks Waqas! glad it helped!
LikeLike
some truly interesting details you have written.
LikeLiked by 1 person
thanks
LikeLike
Pingback: Email Template Demystified – Passion Dynamics
Pingback: Email Template Demystified - Microsoft Dynamics CRM Community
is there a way to fetch other fields from the lookup entity
Something like this: (because when I tried this the CRM is only able to pick data for name and not any other fields for lookups)
Optionset : {!new_loan:new_loantype/@tenure;}
Optionset : {!new_loan:new_loantype/@interestrate;}
LikeLike
Hey the above example is perfect.
I had a concern of loading other values from lookup entity
Something like
Optionset : {!new_loan:new_loantype/@name;} //works
Optionset : {!new_loan:new_loantype/@tenure;} //does not work
Optionset : {!new_loan:new_loantype/@interestrate;} //does not work
Can you help me with this
LikeLike
Hi Vijay,
At the moment its not supported. You can just take value of the lookup record. however cannot go inside that record to get its other field values.
I m trying figure out if we can do something about it. I will keep you posted.
LikeLike
HI Is there any finding yet on how get values within a look up entity please?
LikeLike
This is awesome, but am having issues with a boolean/two option. I tried the /@name but that did not work. Any ideas?
LikeLike
i tried this, when i send an email the fields are empty.
LikeLike
Pingback: Creating Tables In A Custom Entity Global Email Template Made Easy! • HSD
This is the best I have seen but I am still not clear on the format for the lookup value. Since its not {!EntityLogicalName:FieldLogicalName;}.
Your help is greatly appreciated
LikeLike