Search code examples
dynamics-crmworkflow

Run asynchronous job on Quick Campaign


I want to have a button on Quick Campaign form that runs a workflow on all letters connected to the specific Quick Campaign. Since there are possibly thousands of letters, this must be done asynchronously.

First idea was to create a workflow that does that and the button on the form executes this workflow, but since the Quick Campaign is not a real entity, it is not possible to create a workflow for it.

Any ideas?


Solution

  • You did not say anything about the version of the CRM, so I'm assuming it's CRM 2016. You can fulfil your requirement using custom Action. Simply create a process of type Action, that will be global (as you cannot run it on Quick Campaign as you already figured out). As the income parameter simply pass an entity reference for your Quick Campaign. Now you can create a plugin (asynchronous) that will run on this action (Post Operation). There you can do whatever logic you want. Actions can be very easily called from webAPI, so you can easily do it from your button.