Answered by:
Implementation of List variable in Output parameter of a Custom Workflow

Question
-
I have created a custom workflow where I am returning two Output Parameters of type
"public OutArgument<EntityReference> Variable { get; set; }"
Whereas my 'Variable' value is set from a linq query output, that returns multiple values. But my Output Variable does not support multiple values being returned ( like of type List or Array). It just persists the last value returned by linq query.
However it does not have any datatype supporting multiple value being return.
If i try using <List>
public OutArgument<List> Variable { get; set; }
It gives me following error
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The type OutArgument`1 of the property Variable is not supported. Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <ErrorCode>-2147200995</ErrorCode> <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> <Message>The type OutArgument`1 of the property Variable is not supported. </Message> <InnerFault> <ErrorCode>-2147200995</ErrorCode> <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> <Message>The type OutArgument`1 of the property Variable is not supported. </Message> <InnerFault i:nil="true" /> <TraceText i:nil="true" /> </InnerFault> <TraceText i:nil="true" /> </OrganizationServiceFault> Server stack trace: at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.Xrm.Sdk.IOrganizationService.Update(Entity entity) at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.UpdateCore(Entity entity) at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Update(Entity entity) at PluginRegistrationTool.RegistrationHelper.UpdateAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly, PluginType[] type) in D:\sdk\tools\pluginregistration\RegistrationHelper.cs:line 263 at PluginRegistrationTool.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e) in D:\sdk\tools\pluginregistration\PluginRegistrationForm.cs:line 391
Is there any way to retrieve the multiple values (or a List ) from Custom Workflow?
- Edited by Priyanka_More Friday, June 14, 2013 6:41 AM
Friday, June 14, 2013 6:40 AM
Answers
-
Hi Priyanka,
Workflows do not support output variables containing lists of entities since there can't be used through the user interface.
Dialogs do support lists (Query Crm Steps) - you would define the output variable as :
public OutArgument<EntityCollection> Variable {get;set;}
hth
Scott Durow
Blog: www.develop1.netFollow Me
Rockstar365 Profile
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"- Proposed as answer by JLattimerMVP, Moderator Friday, June 14, 2013 8:49 PM
- Marked as answer by Priyanka_More Monday, June 17, 2013 5:32 AM
Friday, June 14, 2013 8:24 AMAnswerer -
For reference, http://technet.microsoft.com/en-us/library/gg327984.aspx has the list of supported custom workflow activity parameter data types.
- Marked as answer by Priyanka_More Monday, June 17, 2013 5:32 AM
Friday, June 14, 2013 6:39 PM
All replies
-
Hi Priyanka,
Workflows do not support output variables containing lists of entities since there can't be used through the user interface.
Dialogs do support lists (Query Crm Steps) - you would define the output variable as :
public OutArgument<EntityCollection> Variable {get;set;}
hth
Scott Durow
Blog: www.develop1.netFollow Me
Rockstar365 Profile
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"- Proposed as answer by JLattimerMVP, Moderator Friday, June 14, 2013 8:49 PM
- Marked as answer by Priyanka_More Monday, June 17, 2013 5:32 AM
Friday, June 14, 2013 8:24 AMAnswerer -
For reference, http://technet.microsoft.com/en-us/library/gg327984.aspx has the list of supported custom workflow activity parameter data types.
- Marked as answer by Priyanka_More Monday, June 17, 2013 5:32 AM
Friday, June 14, 2013 6:39 PM