Personalized Community is here!
Quickly customize your community to find the content you seek.
Check out the latest Sales updates!Learn about the key capabilities and features of Dynamics 365 Sales and experience some of the new features.
Download overview guide | Watch Sales video
2021 Release Wave 1Discover the latest updates and new features to Dynamics 365 planned April 2021 through September 2021.
Release overview guides and videos Release Plan | Preview 2021 Release Wave 1 Timeline
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
Until CRM 4 there were Workflows that could be used for asynchronous processing of business logic, generally used for setting up automated actions and defining sales process in Dynamics CRM.
Since CRM 2011, the workflows became a category under Processes and there was another category Dialogs introduced. Dialogs provided for execution of Dialog scripts to set up process flows for the Salesforce. These could be used to guide the sales people through the sales process using a question/answer format. The Dialog included execution of automated steps like the workflows.
With CRM 2013, the Processes have been extended to now include Business Process Flow and Actions in addition to the categories from the previous versions. In our earlier blog we have discussed the concept of Business Process Flow (hyperlink to earlier blog). This article will concentrate on Actions.
What are Actions?
Actions are messages that can defined for an entity. Existing examples messages include Create, Update, Set State, Assign etc. With Actions, the CRM platform has enabled the creation of custom actions for entities to extend the XRM platform.
Where to use Actions?
An example of a custom action could be “Approve”. Often times we have to design an approval process for Dynamics CRM. Once the item is approved, certain actions need to be performed. In previous versions it would either be implemented as a Workflow that is manually executed from the Workflows Dialog or it involved added of a custom attribute that when checked would imply the item is approved and then the workflow would capture the update of this field to process any automated actions defined.
How to setup an Action?
Let us take an example of an approval process. When an item is “Approved”, we want to send email notifying the concerned parties of the approval.
Here in this above script RequestName indicates the Unique Name of Action and Parameters contains collection of key value pairs that can be passed to Action. In above script We can use below function using below syntax.
You can register plugin on the Approve message. The input parameters of the Approve message will receive the input parameters as defined in the Approve Action.
The plugin registration tool will start showing this message for the Order entity to register plugin against.
Once the plugin is registered, in the code you can access the input parameters just like you do for other messages as shown below
To get access to the image of the Order record
EntityReference entityRef = localContext.PluginExecutionContext.InputParameters["Target"] as EntityReference;
To read the ApprovedBy input parameter
EntityReference approvedBy = localContext.PluginExecutionContext.InputParameters["ApprovedBy"] as EntityReference;
In the pre-stage, you can throw an InvalidPluginExecution error to abort the Approve operation.
Actions is a powerful tool in the hands of the developer to truly extend the CRM platform for XRM implementations.
Posted by: Inogic
For more information/discussions (documents, sample code snippets, detailed work flow or diagrams)
Please be free to visit the following links or email us:
I've created an Action, tried to trigger it from JS using SOAP call. Its not getting triggered.
I've called it from custom code, it works fine. With SOAP call, the request gets succeeded with response statuscode =200 , but no impact on Action. Could you pls help out?
Business Applications communities