问题
I have a workflow that has a 'Prompt and Response' dialogue. I can run the workflow from the API using ExecuteWorkflowRequest but how do I provide values for the prompt and response inputs?
回答1:
Workflows don't take parameters.
Dialogs take parameters, which are generally passed from other dialogs or queries.
The only thing I managed to do is to pass a related entity from parent workflow as the primary entity to a child workflow.
回答2:
I'm going to retract my earlier answer and upvote @Grigory instead.
See this page from the SDK
Note Due to the interactive nature of the dialog process, you cannot run a dialog using the Microsoft Dynamics CRM SDK. A dialog can only be run through the Microsoft Dynamics CRM Web application and are not supported in Microsoft Dynamics CRM for Microsoft Office Outlook with Offline Access.
I don't know the answer, but I'd be fairly confident that this is:
- Possible
- Unsupported (as it is not documented in the SDK)
If I really needed to find out then I'd write a plugin to explore what happens when a workflow is fired internally (this makes an assumption that such a message is fired via the plugin pipeline - not necessarily a correct assumption).
I'd register this plugin on all stages of the Execute message (I assume) and then use debug logging or an interactive debug session (attached to the Async service) to examine the InputParameters (and maybe OutputParameters and ExtensionData) of the ExecuteWorkflowRequest that is (hopefully) generated when CRM runs a workflow that does have parameters. I expect that one of those PropertyBags will contain some sort of parameter.
来源:https://stackoverflow.com/questions/10978236/pass-a-parameter-to-a-crm-2011-workflow-via-the-api