How to customize email template in crm 2016 by code

坚强是说给别人听的谎言 提交于 2019-12-07 12:46:18

问题


I am using CRM 2016, and trying to customize email template by adding a dynamic data. I know that CRM allows to use only specific vanilla entities, but when I explorer an old code I found an option to use {0}, {1} etc' for injecting data from non vanilla entities (by code) - unfortunately that code cannot be tested... Have someone heard or know about that way? is it possible? what to google for?


回答1:


You can do this by manually typing similar marker what CRM is using. Note that this is not documented in SDK.

Dynamic Values For Custom Entities In Email Templates

In the template, where you want the value to appear, type within 2 brackets an exclamation point followed by the entity logical name. After the entity name, add a colon, and then the field logical name, ending it with a semi colon. If you’d like a default value if nothing was found, after the semi colon add the default value.

{!<entitylogicalname>: <fieldlogicalname>; <Default Text>}

More in part 2:

The Global Template Type is what you’d want to use for custom entities, or any other entity not listed in the template type drop down menu. And just to reiterate, regardless of the way you insert values, whether you use the out of the box insert method or you manually type it in, you can only insert values from one record.

Dynamic Values For Email Templates - Part 2




回答2:


Dynamics' email templates are flawed. You either can't use custom entities or you have no translation. I use this workflow instead. It can do everything : https://github.com/rtebar/dynamics-custom-emails



来源:https://stackoverflow.com/questions/47649621/how-to-customize-email-template-in-crm-2016-by-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!