13.08.2009, 15:05 | #1 |
Участник
|
Dynamics CRM Tools: Workflow: Add rich HTML content in email body
Источник: http://mscrmtools.blogspot.com/2009/...-in-email.html
============== One of the limitations of workflow in Microsoft Dynamics CRM 4.0 is the uncapability to add dynamic HTML content. By dynamic, I mean with data from the item that triggered the workflow. We all know the trick of copy/paste to add static HTML in the mail but to add dynamic content is a different kettle of fish ... In particular, I think about the following needs:
For example: Click herewill just display Click hereIn the same way, you can display HTML table with CRM content and insert it in mail body. [UPDATE] Code example - Url builder. This code create an hypertext html control that will be used in email body. You can set a text for the hypertext control with the input property and you get back the hypertext control in output property 1: public class EntityUrlHelper : SequenceActivity 2: { 3: public static DependencyProperty linkProperty = DependencyProperty.Register("link", typeof(string), typeof(EntityUrlHelper)); 4: 5: [CrmOutput("Link")] public string link 6: { 7: get 8: { 9: return (string)base.GetValue(linkProperty); 10: } 11: set 12: { 13: base.SetValue(linkProperty, value); 14: } 15: } 16: public static DependencyProperty textLinkProperty = DependencyProperty.Register("textLink", typeof(string), typeof(EntityUrlHelper)); 17: 18: [CrmInput("Hypertext link text")] 19: public string textLink 20: { 21: get 22: { 23: return (string)base.GetValue(textLinkProperty); 24: } 25: set 26: { 27: base.SetValue(textLinkProperty, value); 28: } 29: } 30: 31: protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext) 32: { 33: IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService)); 34: IWorkflowContext context = contextService.Context; 35: 36: link = "" + textLink + ""; 37: return ActivityExecutionStatus.Closed; 38: } 39: } Источник: http://mscrmtools.blogspot.com/2009/...-in-email.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|