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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 02.06.2011, 00:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
gustafwesterlund: Problem with Custom Workflow Activities in CRM 2011
Источник: http://gustafwesterlund.blogspot.com...ctivities.html
==============

The workflow activities framework for CRM 2011 has been upgraded from CRM 4.0. The dependance properties have been removed and it now support the simplified datatypes used in CRM 2011 like DateTime.

I was developing a custom activity today and I had an output argument that was of the type EntityReference. However, when I tried to run it I got a weird error:

"The argument of type 'Microsoft.Xrm.Sdk.EntityReference' cannot be used. Make sure that it is declared on an activity."

The argument declaration looked like this:

[Output("The Output of special entity")]
[ReferenceTarget("new_specialentity")]
public OutArgument specOut { get; set; }

And I am trying to set it with the following code:

specOut = new OutArgument();
Entity outent = entities.Entities[0];
specOut.Set(executionContext, outent.ToEntityReference());

I had also tried creating the entity reference with a default contstructor and filling id and logicalname, with the constructor setting id and logicalname. I had even tried setting it using the entity directly but they all give the same error. I had not found anything useful on the internet or in the SDK.

After some rethinking I looked closer at the error message and thought that there might be something wrong with the declaration or definition of the OutArgument. And after some tries I found that the error was that I had created a new OutArgument which is wrong, it is precreated and this was the reason for the error. Hence I just removed the line:

specOut = new OutArgument();

and it work like it should have from the beginning.

It is always interesting to work with new technology!

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB

www.crmkonsulterna.se


Источник: http://gustafwesterlund.blogspot.com...ctivities.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Microsoft Dynamics CRM Team Blog: Upgrading a CRM 4.0 Custom Workflow Activity to CRM 2011 Blog bot Dynamics CRM: Blogs 0 18.11.2010 01:12
Microsoft Dynamics CRM Team Blog: Custom workflow actions in Microsoft Dynamics CRM 2011 Online Blog bot Dynamics CRM: Blogs 0 09.11.2010 19:05
Все о Microsoft Dynamics CRM: Как установить Microsoft Dynamics CRM 2011 Beta Blog bot Dynamics CRM: Blogs 0 31.10.2010 15:08
Ошибка бизнес-процесса Tarasov E Dynamics CRM: Разработка 9 18.02.2010 14:02
Microsoft Dynamics CRM Team Blog: Workflow E-mail Utilities Blog bot Dynamics CRM: Blogs 0 16.12.2008 23:05

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

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

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