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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 01.07.2016, 15:28   #10  
Ion is offline
Ion
Участник
 
332 / 16 (1) ++
Регистрация: 19.12.2012
Насколько я понял, то нет возможности создать html-таблицу в appointment, чтоб она нормально рендерилась в Outlook.

Что имею на сейчас:
X++:
   public class AppointmentCreator
    {
        private IOrganizationService _service { get; set; }
        private Guid _appointmentId = Guid.Empty;
        private Guid _templateId = new Guid("5f835b71-763f-e611-80de-005056883160");
        private Guid _userId = new Guid("db4e2fd9-d727-e611-80de-005056883160");
        public AppointmentCreator(IOrganizationService service)
        {
            _service = service;
        }

        public void Create()
        {
             Entity[] activityParty = new Entity[]
                {
                                new Entity("activityparty")
                            {
                                Attributes =
                                      {
                                                    { "partyid",  new EntityReference("systemuser", _userId) }
                                      }
                              }
                };

            // Create the appointment instance.
            Entity appointment = new Entity("appointment");
            appointment["subject"] = "Test Appointment";
            appointment["description"] = HtmlHelper.htmlTable;//mailTemplate.GetAttributeValue<string>("body");
            appointment["scheduledstart"] = DateTime.Now.AddHours(1);
            appointment["scheduledend"] = DateTime.Now.AddHours(2);
            appointment["location"] = "Office";
            appointment["requiredattendees"] = activityParty;
            appointment["organizer"] = activityParty;

            // Use the Book request message.
            BookRequest book = new BookRequest
            {
                Target = appointment
            };
            BookResponse booked = (BookResponse)_service.Execute(book);
            _appointmentId = booked.ValidationResult.ActivityId;

            // Verify that the appointment has been scheduled.
            if (_appointmentId != Guid.Empty)
            {
                Console.WriteLine("Succesfully booked {0}.", appointment.GetAttributeValue<string>("subject"));
                Console.ReadKey();
            }
        }
    }
И простенький класс

X++:
   public static class HtmlHelper
    {
        public static string htmlTable = @"<table border = '1' >
            < caption > Таблица размеров обуви</caption>
            <tr><th>Россия</th><th>Великобритания</th>
            <th>Европа</th><th>Длина ступни, см</th>
            </tr><tr><td>34,5</td><td>3,5</td><td>36</td><td>23</td></tr></table>";

        public static string htmlH1 = "<h1>My test body</h1>";
    }
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Crm 2013: Appointment in Calendar gibor2000 Dynamics CRM: Разработка 4 13.05.2014 15:59
Microsoft Dynamics CRM Team Blog: Exploring Recurring appointment and Linked fields Blog bot Dynamics CRM: Blogs 0 29.04.2011 00:11
Microsoft Dynamics CRM Team Blog: Demystifying Recurring Appointment update recurrence logic: How history of past instances is saved in CRM Blog bot Dynamics CRM: Blogs 0 25.04.2011 19:11
Microsoft Dynamics CRM Team Blog: Demystifying the Recurring Appointment series expansion in Microsoft Dynamics CRM 2011 Blog bot Dynamics CRM: Blogs 0 09.12.2010 02:13
mscrm4ever: Summarizing an Appointment field on a Parent Entity Blog bot Dynamics CRM: Blogs 0 12.06.2009 15:05

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

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

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