Trigger plugin using Action


There are many scenarios that we needs to trigger plugin from ribbon / command bar. For this kind of scenario what we do, we create dummy entity and then call some message from JavaScript of  that dummy entity to trigger our plugin (you can explore this example from here ). This is what we do for MS CRM 2011, but from MS CRM 2013 onward, Microsoft CRM introduced ‘Action’ process.

Using Action we can trigger plugin, steps for that are …

  1. Get Process.js from here ‘‘,  add it in MS CRM
  2. Register ‘Process.js’ on form where your plugin is going to trigger, ref below example
  3. 1
  4. Create an empty ACTION process, ref below example, create action on same entity where you want to trigger your plugin
  5. 2
  6. Create JavaScript function ref. below example, which will trigger Action on button click.
  7. //to trigger action 
    function triggerAction() {
     key: "Target",
     type: Process.Type.EntityReference,
     value: { id:, entityType: "quote" }
     key: "Test",
     type: Process.Type.String,
     value: "Something"
     function (params) {
     // Success
     for (var i = 0; i < params.length; i++) {
     alert(params[i].key + "=" + params[i].value);
     function (e) {
     // Error
  8. Open plugin registration tool, and register plugin, you will notice once difference here is, you will get Action name in message box, just register plugin on that message, ref. below example
  9. 3
  10. Now you will get entity details in plugin as EntityReference, ref. below screen shot
  11. 4
  12. That’s it.


Explore more about Action here


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s