SBX - Search With Button

SBX - Forum Post Title

CRM 2016 - When to use an Action process vs a Workflow

Microsoft Dynamics CRM Forum

Allison Walters asked a question on 7 Apr 2016 5:49 PM
My Badges

Question Status

Verified

I'm experimenting with Actions and Workflows for some processes we need to run in CRM.  And I have to admit, I'm having a tricky time figuring out when to use an Action - I haven't yet seen what they can do that a Workflow can't.  Does anyone have any examples of what an Action can do that can't be done elsewhere, and/or any other circumstances where one would specifically want to use Actions instead of Workflows?

One page that I saw had an example of Creating a Contact from an Account, but that seems to be fully able to be done in a Workflow as well.  I wonder if there used to be more of a difference, say in 2013, before features were added more recently?

Thanks!

Reply
Jason Cosman responded on 7 Apr 2016 8:27 PM
My Badges

Hello AWalters;

Your absolutely right it can be confusing as to when to use an action vs a workflow. I personally like actions as compartments of functionality meant to reduce the amount of code or duplication in your workflows. It is worth noting that actions can't trigger off of the same rules of a worklow unless your using java-script or something.

For example if you had the requirement of when an account or contact gets reassigned we need to send an email to the newly assigned person and then create a task to follow up for this person in 5 days. In this case this would be two seperate processes; one for the account entity and one for the contact entity. Instead of having the same logic duplicated in both of these workflows; i'd rather build a simple action that does this sending of email + creation of task. I'd then take the new action and execute it from each workflows. This is a very simplistic answer of course but I try to use actions to minimize duplication or for business functions that will need to be repeated.

I hope this helps!

Reply
Allison Walters responded on 8 Apr 2016 11:08 AM
My Badges

From what I can tell, as of 2016, actions can be called from workflows OOTB so no need for javascript anymore.

For your other examples of compartmentalizing code/logic, I do like to do that, but couldn't you use a child workflow in exactly the same way?  (i.e. have a workflow that does the email + creation tasks, then call it as a child workflow from multiple other workflows?)

Reply
Jason Cosman responded on 8 Apr 2016 1:26 PM
My Badges

Well there are differences in terms of the custom actions that can take parameters in like entities or entity collections etc... This is where I see some of this main stream value for the Actions.

Your correct that actions can be called from Workflows and that makes sense but actions cant be triggered like on an account creation like a normal workflow would be able to.

Reply
Verified Answer

a workflow requires always a record as starting point (created, updated, deleted or on-demand), an action no.

Let's say you create an action that create an email to the manager, the action is not binded to a crm record, can be included or not inside a workflow, can be called by c# code, can be edited by the crm built-in editor. It's a piece of server side code with a designer.

Reply
Allison Walters responded on 8 Apr 2016 1:41 PM
My Badges

Ah - that makes perfect sense.  Thank you!!

Reply
rajapriyan g responded on 11 Jul 2017 11:56 PM

from my view, most of the business logic can be written in action and can be called from Plugin or workflow or from java script

so that in future if business logic has to be changed , we can do changes directly from action and it will get reflected in all the other triggering processes

Reply
Sonali Dubey responded on 27 Jul 2017 10:56 AM

Is there any difference between action and custom action?

Reply
Niraj Rai responded on 1 Aug 2017 12:47 PM
PriyaP responded on 11 Oct 2017 7:43 AM

You can say you don't need to write code for the logic you have set in action. For example, you want to update case on the condition you want and not on any record creation or updation, then you simply go and create action which will update case. Now go to your code(plugin,java script), and instead of writing logic to update case, YOU CALL YOUR ACTION

Reply
Mohit Rao responded on 28 Mar 2018 9:33 AM

Hi

I too had a similar confusion and we used actions to reduce the amount of duplicate and similar code to be used across many entities

In my case we had to do Cloning functionality and many custom entities need to have this feature at that time we wrote a generic cloning action code and on each entity which required cloning put up a button and called this Cloning action

in that way we used  

Reply
Bessell-Browne responded on 27 Nov 2018 4:58 AM

Dynamics of the community have been upheld for the entertainment of the kids. The stage is set forth for the movement of the online assignment for all serving officers in the town. The community is fully engrossed in the ambit for the reforms and all challenges for the people.

Reply
Verified Answer

a workflow requires always a record as starting point (created, updated, deleted or on-demand), an action no.

Let's say you create an action that create an email to the manager, the action is not binded to a crm record, can be included or not inside a workflow, can be called by c# code, can be edited by the crm built-in editor. It's a piece of server side code with a designer.

Reply

SBX - Two Col Forum

SBX - Migrated JS