AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 13.08.2009, 15:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,626 / 848 (80) +++++++
Регистрация: 28.10.2006
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:
  • Display a table containing the information related to the current record (eg list of contacts from an account)
  • Show a link to a form without displaying any url but just a clickable word
Note that it is possible to manage these cases with custom workflow activities. In fact, when you insert a workflow output text in an email, the content is not encoded, ie you can pass HTML tags that will be interpreted as such.

For example:

Click here
will just display

Click here

In 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, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Microsoft Dynamics CRM Team Blog: Building Rich-Client Dashboards for Microsoft Dynamics CRM with Windows Presentation Foundation Blog bot Dynamics CRM: Blogs 1 31.03.2009 13:24
Microsoft Dynamics CRM Team Blog: List Web Part for Microsoft Dynamics CRM 4.0 Deployment Scenarios Blog bot Dynamics CRM: Blogs 0 30.01.2009 22:05
Microsoft Dynamics CRM Team Blog: Microsoft Dynamics CRM 4.0 Bookshelf Blog bot Dynamics CRM: Blogs 1 22.01.2009 04:46
Microsoft Dynamics CRM Team Blog: Microsoft Dynamics CRM, Email correlation and smart matching Blog bot Dynamics CRM: Blogs 0 12.11.2008 04:08

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 13:49.