What is Workflow?
- It is a series of steps (methods or functions) which execute sequentially and change the direction of flow based on condition.
- It is a tool for managing data and processes.
- It helps to implement standardized Business Processes to help their operation run smoothly and consistently.
Workflow In MSCRM
- It executed asynchronously.
- "Microsoft CRM Asynchronous Processing Service" is the Windows service which helps the workflow to execute. It acts as an Host application for the workflow engine to work.
- Since workflows execute asynchronously, they don't run immediately and depending on the server overhead, it takes some times to complete.
How to Create Workflow in MSCRM
Select the Setting option from Left side of the navigation pane in MSCRM:
Settings--------------->Workflows-------------------->New
Initiates Workflow in MSCRM
In Microsoft Dynamic CRM, Workflow rules are initiated in three ways which are mentioned below:
- Manually by the user
- Trigger an event (automatically)
- From another Workflow Process (child workflow)
Description of the Above Points
Manually by the User
In this case, User runs the Workflow manually by going to the associated Entity and Clicking the "Run Workflow" button.
Step 1: Select the Setting option from the Left navigation pane in MSCRM:
Step 2: Select the Workflows:
Step 3: Select the "New" option, Workflow New Dialog open:
- Enter the Workflow Name option.
- Select the Entity option.
- Select the Type option
Step 4: Click Ok button. The new form will be opened.
In this case, we have to select the "On Demand" option in "Available to Run".
Trigger an Event (Automatically)
The events that triggers the Workflow are mentioned below:
- Record is created: When a new instance of an Entity is created.
- Record status changes: When the entity status changed. Some examples are given below:
Entity | Status |
Accounts | Active, Inactive |
Cases | Active, Canceled, Resolved |
Contacts | Active, Inactive |
Users | Disabled, Enabled |
- Record is assigned: Assign the associated entity to the user.
- Record attributes change: When the attribute of the entity changed.
- Record is deleted: When the Instance of the associated entity is deleted.
From Another Workflow Process (child workflow)
In this case, we have to select the "As a Child Workflow" option in "Available to Run". Here, the Workflow runs the another Workflow.
Workflow Scope in MSCRM
- User
- Business Unit
- Parent: Child Business Units
- Organization
When We Used Workflow or Plug-ins
If you need the process to run synchronously, then go for Plug-ins and if you need process to run asynchronously, then go for Workflow.
Creating Workflow in MSCRM
Step 1: Select the Setting option from left side of the navigation pane in MSCRM.
Step 2: Select the Workflows option:
Step 3: Select the New option and Set the "Workflow Name","Entity" and "Type".
Click the "Ok" button.
Step 4: Set the values as per requirement.
Step 5: Click On "Add Step" option.
Select the Step as requirement. Following steps are mentioned below:
- Stage: It is used for grouping purpose and is stored in database
- Check Condition
- Wait Condition: Stop the execution of Workflow for a certain period of time
- Create record
- Update record
- Assign record
- send E-Mail
- Start Child Workflow: Execute the Child Workflow
- Change Status
- Stop Workflow
Step 6: Click Save and Close to continue.
Step 7: Publish the Workflow for activation.
Step 8: Click Ok.
Reference
- Working with Microsoft Dynamic CRM 4.0 (Author:- Mike Snyder,Jim Steger)
- Microsoft Dynamic CRM 4.0 Unleashed (Author :- Marc J. Wolenik; Damian Sinay)