问题
[ReferenceTarget("contact")]
public InOutArgument<EntityReference> PartyList{ get; set; }
How can I return/send a list of ActivityParty or a EntityCollection from a custom CodeActivity back to the workflow step?
Inside my execute
method, when I return an EntityCollection or a List I get a type conversion error.
From the responses below - I wanted to add some clarification: How can I pass any collection back, I see the list is limited - I was looking for a workaround. Since EntityReference was a reference/pointer type
回答1:
EntityCollection is not in supported list of Input/Output type of Custom Workflow activities: MSDN
What you are trying to achieve by getting EntityCollection in WF step, it should be achievable inside WF activity itself.
You are getting conversion error because your output param type is EntityReference.
回答2:
You cannot use type EntityCollection
in generic InOutArgument<T>
properties.
Supported types are:
- Boolean
- DateTime
- Decimal
- Double
- EntityReference
- Int32
- Money
- OptionSetValue
- String
See MSDN.
来源:https://stackoverflow.com/questions/47046596/how-to-return-entitycollection-as-outparameter-custom-activity