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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 19.02.2010, 23:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Muhammad Ali Khan: Close Service Activity On Create Message In PlugIn
Источник: http://malikhan.wordpress.com/2010/0...age-in-plugin/
==============


Here is a simple code to close the service activity in a MS CRM Plugin.

1: SetStateServiceAppointmentRequest req = new SetStateServiceAppointmentRequest(); 2: req.ServiceAppointmentState = ServiceAppointmentState.Closed; 3: req.ServiceAppointmentStatus = 8; 4: req.EntityId = new Guid(context.OutputParameters["id"].ToString()); 5: SetStateServiceAppointmentResponse resp = (SetStateServiceAppointmentResponse)crmService.Execute(req); But the above code will work perfectly only if the message is Post Update but doesn’t work if the message is Post Create means it doesn’t close the service activity. Strangely, it doesn’t give any error as well. To add to my surprise, if you had configure any plugin on “SetState” or “SetStateDynamic” for serviceappointment even those plugin will be trigger, but the state of the service activity will not change. Why?, i am not sure.

But does this means we cannot close service activity on the “Create” message?, well the trick is to register the above plug-in as Asynchronous mode (as shown below). now the above message will Close the Service Activity even on the Create Message.





Источник: http://malikhan.wordpress.com/2010/0...age-in-plugin/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Ошибка бизнес-процесса Tarasov E Dynamics CRM: Разработка 9 18.02.2010 14:02
Muhammad Ali Khan: Relating/Connecting MS CRM 4.0 Data With Custom External Content Type Data In SharePoint 2010 Blog bot Dynamics CRM: Blogs 0 04.02.2010 13:05
Muhammad Ali Khan: Using Business Connectivity Services(BCS) In SharePoint 2010 For Connecting To MS CRM 4.0 Blog bot Dynamics CRM: Blogs 0 25.01.2010 01:08
Muhammad Ali Khan: Business Connectivity Services (BCS) Using WCF & SharePoint Designer 2010 Blog bot Dynamics CRM: Blogs 0 12.01.2010 04:44
Pokluda: Outbound web service (AIF) Blog bot DAX Blogs 0 28.10.2006 17:43
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 02:40.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.