Load BusinessProcessFlow thru JavaScript in Dynamics 365

There is a known defect loading active Business Process Flow on the Form, when you upgrade from CRM 2016 to Dynamics 365. It does not load for some records which came thru ETL. If you check in Advanced Find including Process Id column, Process Id is NULL for these records.

If you want to show BPF for these records which Process id is NULL, you need to call following JS in the form load event.

function setProcessId() {
var processId = Xrm.Page.context.getQueryStringParameters().process;
if (processId == null) {
//Business Process Flow Id
var procesGuid = '03278623-2923-443A-957C-AF56D1B1FC81';
Xrm.Page.data.process.setActiveProcess(procesGuid, function callbackFunction() { });
}
}
Advertisement

Workflow processes in Dynamics CRM 2013

Workflows automate business processes without a user interface. People usually use workflow processes to initiate automation that doesn’t require any user interaction.
Though workflows are not new in Dynamics CRM 2013, however Microsoft introduced new feature in Dynamics CRM 2013 that allows users to create real-time/synchronous workflows.
Each workflow process is associated with a single entity. When configuring workflows you have four major areas to consider:

  • When to start them?
  • Should they run as a real-time workflow or a background workflow?
  • What actions should they perform?
  • Under what conditions should actions be performed?

1. Where do you customize workflow processes?
You can see the workflows in your organization by viewing the ‘Processes’ node in the ‘Default Solution’ and filtering on processes that have the ‘Category Workflow’.
Workflows1

2. Workflow properties
In the solution explorer, select ‘Processes’ and click ‘New’.
When you create a workflow the ‘Create Process’ dialog requires that you set three properties that all processes have:
Workflows2
– Process name: The name of the workflow process does not need to be unique, but if you expect you will have a lot of workflows, you may want to use a naming convention to clearly differentiate your processes. You may want to apply standard prefixes to the name of the workflow. The prefix may describe the function of the workflow or the department within the company. This will help you group similar items in the list of workflows.
– Category: This property establishes that this is a workflow process.
– Entity: Each workflow process must be set to a single entity. You can’t change the entity after the workflow process is created.
– Run this workflow in the background (recommended): This option appears when you select workflow as the category. This setting determines whether the workflow is a real-time or background workflow. Real-time workflows run immediately (synchronously) and background workflows run asynchronously. The configuration options available depend on your choice for this setting. Background workflows allow for wait conditions that are not available for real-time workflows. As long as you don’t use those wait conditions, at a later time you can convert background workflows to real-time workflows and real-time workflows to background workflows.
You also have the ‘Type’ option to specify whether to build a new workflow from scratch or choose to start from an existing template. When you choose ‘New process from an existing template (select from list)’ you can choose from the available Workflows processes that were previously saved as a process template.
After you create the Workflow or if you edit an existing one, you will have the following additional properties:
Workflows3
– Activate As: You can choose ‘Process template’ to create an advanced starting point for other templates. If you choose this option, after you activate the workflow it will not be applied but instead it will be available to select in the ‘Create Process’ dialog if you select ‘Type: New process from an existing template (select from list)’
Process templates are convenient when you have a number of similar workflow processes and want to define them without duplicating the same logic.
Note: Editing a process template does not change the behaviors of any other workflow processes previously created using it as a template. A new workflow created using a template is a copy of the content in the template.
– Available to Run: This section contain options that describe how the workflow is available to be run.
– Run this Workflow in the background (recommended):This check box reflects the option you selected when you created the workflow. This option is disabled, but you can change it from the ‘Actions’ menu by choosing either ‘Convert to a real-time workflow’ or ‘Convert to a background workflow’.
– As an on-demand process: Choose this option if you want to allow users to run this workflow from the ‘Run Workflow’ command.
– As a child process: Choose this option if you want to allow the workflow to be available to be started from another workflow.
– Scope: For user-owned entities, options are Organization, Parent: Child Business Units, Business Unit, or User. For Organization-owned entities the only option is Organization.
If scope is Organization, then the workflow logic can be applied to any record in the organization. Otherwise, the workflow can only be applied to a subset of records that fall within the scope.
Note: The default scope value is User. Make sure you verify that the scope value is appropriate before you activate the workflow.
– Start When: Use the options in this section to specify when a workflow should start automatically. You can configure a real-time workflow to be run before certain events. This is a very powerful capability because the workflow can stop the action before it occurs.

  • Record is created
  • Record status changes
  • Record is assigned
  • Record fields change
  • Record is deleted

Note: Keep in mind that the actions and conditions you define for the workflow are not aware of when the workflow is run. For example, if you define a workflow to update the record, this action can’t be performed by a real-time workflow before the record is created. A record that doesn’t exist cannot be updated. Similarly, a background workflow can’t update a record that has been deleted, even though you could define this action for the workflow. If you configure a workflow to perform an action that can’t be performed, it will fail and the entire workflow will fail.
– Execute As: This option is only available if you unselected the ‘Run this workflow in the background (recommended)’ option when you created the workflow or if you later converted a background workflow to be a real-time workflow.

3. Security context of workflow processes
When a background workflow is configured as an on-demand process and is started by a user using the Run Workflow’ command, the actions that the workflow can perform are limited to those the user could perform based on the privileges and access levels defined by the security role(s) set for their user account.
When a background workflow starts based on an event the workflow operates in the context of the person who owns it, usually the person who created the workflow.
For real-time workflows you have the Execute As’ option and you can choose whether the workflow should apply the security context of the owner of the workflow or the user who made changes to the record. If your workflow includes actions which all users would not be able to perform based on security constraints, you should choose to have the workflow run as the owner of the workflow.

4. Activate a workflow
Workflows can only be edited while they are deactivated. Before a workflow can be used manually or be applied due to events it has to be activated. Before a workflow can be activated it must contain at least one step.
A workflow can only be activated or deactivated by the workflow owner or by someone with the Act on Behalf of Another User’ privilege such as the system administrator.  The reason for this is that a malicious user could modify someone’s workflow without them being aware of the change. You can reassign a workflow you own by changing the owner. This field is on the Administration’ tab. If you are not the system administrator and you need to edit a workflow that has to owned by another user, you need them to deactivate it and assign it to you. After you finish editing the workflow, you can to assign it back to them and they will need to activate it.
Real-time workflows require that the user have the ‘Activate Real-time Processes’ privilege. Because real-time workflows have a greater risk of affecting system performance, only people who can evaluate the potential risk should be given this privilege.
Workflows are saved when they are activated, so it is not necessary to save them before activating them.

5. Configure workflow steps
When configuring workflows you have four major areas to consider:

  • When to start them?
  • Should they run as a real-time workflow or a background workflow?
  • What actions should they perform?
  • Under what conditions actions should be performed?

 5.1 Workflow stages and steps: When you design workflows you have the option to contain the logic you want to perform in stages and steps.
Stages: Stages make the workflow logic easier to read, and explain the workflow logic. However, stages do not affect the logic or behavior of workflows. If a process has stages, all the steps within the process must be contained with a stage.
Steps: Steps are a unit of business logic within a workflow. Steps can include conditions, actions, other steps, or a combination of these elements.
5.2 Actions that workflow processes can perform: Workflow processes can perform the actions listed in the following table.

Action Description
Create Record Creates a new record for an entity you choose and assigns values you choose to attributes.
Update Record You can update the record that the workflow is running on, any of the records linked to that record in an N:1 relationships, or any records created by earlier steps.
Assign Record You can assign the record that the workflow is running on, any of the records linked to that record with an N:1 relationship, or any records created by earlier steps.
Send Email Sends an email. You can choose to create a new email message or use an email template configured for the entity of the record that the workflow is running on or any entities that have an N:1 relationship with the entity, or the entity for any records created by earlier steps.
Start Child Workflow Starts a workflow process that has been configured as a child workflow.
Change Status Changes the status of the record that the process is running on, any of the records linked to that record with an N:1 relationship, or any records created by earlier steps.
Stop Workflow Stops the current workflow. You can set a status of either Succeeded or Cancelled and specify a status message.When real-time workflows are configured for an event, stopping a workflow with a status of cancelled will prevent the event action from completing.
Custom Step Developers can create custom workflow steps that define actions. There are no custom steps available in Microsoft Dynamics CRM by default.

5.3 Setting record values: When you create a record you can set values for the record. When you update a record you can set, append, increment, decrement, multiply, or clear values.
When you click ‘Set Properties’, a dialog opens showing you the default form for the entity.
At the bottom of the dialog you can see a list of additional fields not present in the form.
For any field, you can set a static value and that will be set by the workflow.
On the right side of the dialog the ‘Form Assistant’ gives you the ability to set or append dynamic values from the context of the current record. This includes values from related records that can be accessed from the N:1 (many-to-one) relationships for the entity.
The options available in the ‘Form Assistant’ depend on the field you have selected in the form. When you set a dynamic value, you will see a yellow placeholder known as a ‘slug’ that shows where the dynamic data will be included. If you want to remove the value, just select the slug and delete it. For text fields, you can use a combination of static and dynamic data.
With dynamic values you don’t know for certain that a field or related entity has the value you want to set. You can actually set a number of fields to try and set the value and sort them in order using the green arrows. If the first field doesn’t have data, the second field will be tried and so on. If none of the fields have data, you can specify a default value to be used.
5.4 Setting conditions for workflow actions: The actions that you will apply often depend on conditions. Workflow processes provide several ways to set conditions and create branching logic to get the results you want. You can check values of the record that the workflow process is running against, any of the records linked to that record with an N:1 relationship, or values within the process itself

Condition Type Description
Check Condition A logical “if-<condition> then” statement.
You can check values for the record that the workflow is running on, any of the records linked to that record in an N:1 relationships, or any records created by earlier steps. Based on these values you can define additional steps when the condition is true.
Conditional Branch A logical “else-if-then” statement, the editor uses the text “Otherwise, if <condition> then:”
Select a check condition you have previously defined and you can add a conditional branch to define additional steps when the check condition returns false.
Default Action A logical “else” statement. the editor uses the text “Otherwise:”
Select a check condition, conditional branch, wait condition, or parallel wait branch that you have previously defined and you can use a default action to define steps for all cases that do not match the criteria defined in condition or branch elements.
Wait Condition Enables a background workflow to pause itself until the criteria defined by the condition have been met. The workflow starts again automatically when the criteria in the wait condition have been met.
Real-time workflows cannot use wait conditions.
Parallel Wait Branch Defines an alternative wait condition for a background workflow with a corresponding set of additional steps that are performed only when the initial criterion is met. You can use parallel wait branches to create time limits in your workflow logic. They help prevent the workflow from waiting indefinitely until the criteria defined in a wait condition have been met.
Custom Step Developers can create custom workflow steps that define conditions. There are no custom steps available in Microsoft Dynamics CRM by default.

5.5 Using real-time workflows: With Microsoft Dynamics CRM 2013 you can configure real-time workflows but you should use them with care. Background workflows are generally recommended because they allow the system to apply them as resources on the server are available. This helps smooth out the work the server has to do and help maintain the best performance for everyone using the system. The drawback is that actions defined by background workflows are not immediate. You can’t predict when they will be applied, but generally it will take a few minutes. For most automation of business processes this is fine because people using the system don’t need to be consciously aware that the process is running.

Use real-time workflows when a business process requires someone to immediately see the results of the process or if you want the ability to cancel an operation. For example, you may want to set certain default values for a record the first time it is saved, or you want to make sure that some records are not deleted.

6. Converting between real-time and background workflows:
You can change a real-time workflow into a background workflow by choosing ‘Convert to a background workflow’ on the toolbar.
You can change a background workflow into a real-time workflow by choosing ‘Convert to a real-time workflow’ on the toolbar. If the background workflow uses a wait conditions it will become invalid and you won’t be able to activate it until you remove the wait condition.

7. Initiating real-time workflows before or after status changes:
When you configure ‘Options for Automatic Processes’ for real-time workflows, the ‘Start When’ options for the status changes event let you select ‘After’ or ‘Before’ for when status changes. The default option is ‘After’.
When you select ‘Before’ you are saying that you want the logic in the workflow to be applied before data changing the status is saved. This provides you with the ability to check the values before other logic has been applied after the operation and prevent further logic from being performed. For example, you may have additional logic in a plugin or custom workflow action which could initiate actions on another system. By stopping further processing you can avoid cases where external systems are affected. Applying real-time workflows before this event also means that other workflow or plug-in actions in Microsoft Dynamics CRM that may have saved data don’t need to be “rolled back” when the operation is canceled.

8. Using the Stop Workflow action with real-time workflows
When you apply a ‘Stop Workflow’ action in a workflow you have the option to specify a status condition that can be either ‘Succeeded’ or ‘Canceled’. When you set the status to canceled, you prevent the operation. An error message containing the text from the stop action status message will be displayed to the user with the heading ‘Business Process Error’.

Ready-to-use Business Processes in Dynamics CRM 2013

Microsoft Dynamics CRM includes several ready-to-use business processes for common sales, service, and marketing scenarios – to help you ensure that staff follows consistent steps every time they work with customers. Before you can use these processes, you need to add them to the system

Add Ready-to-use Business Processes:
1. On the navigation bar, click or tap Microsoft Dynamics CRM -> Settings.
2. Click or tap Settings -> Data Management.
3. Click or tap Add Ready-to-Use Business Processes.
Click or tap Add.

Ready-to-use1
Ready-to-use2Ready-to-use3

Ready-to-use business processes flows are activated automatically when you add them. If a ready-to-use business process includes workflows or portable business logic rules, you’ll need to activate those separately.

The following table shows a list of ready-to-use business processes and what they help you do.
Below screenshots shows list of ready-to-use business processes after installing.

Process Name Category Description
Contact to Order B2C – Fill Ship To fields WF Workflow A synchronous workflow that defaults the Ship To and Address fields on the Order form once the order is created.
In store excellence – create visit WF Workflow A synchronous workflow process that creates a store visit once the Order Priority is set to Default Value.
Opportunity to Invoice B2B – OrderToInvoice WF Workflow A synchronous workflow process that updates the Bill To fields on the new Invoice form.
Opportunity to Invoice B2B – QuoteToOrder WF Workflow A synchronous workflow process that updates the Ship To fields on the Order form based on quote values.
Opportunity to Invoice B2B – OptyToQuote WF Workflow A synchronous workflow process that updates the Description and Ship To fields on the Quote form based on opportunity values.
Service Appointment Scheduling_Create a follow up phone call Workflow A synchronous workflow process that creates a Phone Call if Case Follow up Task Created equals ‘Yes’
Upsell after service interaction – create upsell task WF Workflow Create an upsell task if the customer experience is good. For an unsatisfactory customer experience, a follow-up customer activity is also created.
Contact to order (Business-to-Business) Business Process Flow Target sales by using a consistent method to interact with customers.
Email sales campaign Business Process Flow Email prospects, create and qualify leads, develop opportunities, and then close deals.
Collaborative Selling Business Process Flow Collaborative sales helps sales people add other members of the organization to the sales team. The new members of the sales team are able to review the opportunity and their roles on a mobile device
Guided service case Business Process Flow Make sure that data is entered consistently for service cases, and that required activities are completed to resolve a case.
Phone sales campaign Business Process Flow Call prospects, create and qualify leads, develop opportunities, and then close deals.
Service appointment scheduling Business Process Flow Schedule service appointments, set up reminders, and make sure service activities are completed.
Marketing list builder Business Process Flow Create targeted marketing lists for accounts, contacts, or leads, add prospects, and gain manager approval.
Opportunity to invoice (Business-to-Business) Business Process Flow Follow a standard process for assessing needs, negotiating outcomes, fulfilling orders, and closing opportunities when selling to other businesses.
Service case upsell Business Process Flow Upsell additional products or services while resolving a customer’s service request.
Multichannel sales campaign Business Process Flow Contact prospects by phone and email, create and qualify leads, and then close deals.
In store excellence Business Process Flow Suggest orders for store owners and field personnel and gain acceptance from store managers for those orders
Upsell after service interaction Business Process Flow Turn a good service experience into an opportunity to upsell more products and services to the customer.

Ready-to-use4

Delete Ready-to-use Business Processes: Follow below steps to delete all ready-to-use business processes from the system.

1. On the navigation bar, click or tap Microsoft Dynamics CRM -> Settings.
2. Click or tap Settings -> Solutions.
3. Select the ‘BusinessProcesses’ solution and click on ‘Delete’ command to remove all Ready-to-use Business Processes.

Ready-to-use5

Business Process Flows in Dynamics CRM 2013

Business process flows are a new feature in Microsoft Dynamics CRM 2013. Business process flows use the same underlying technology as other processes, but the capabilities that they provide are very different from other features that use processes.

1. Why use business process flows?

Business process flows provide a guide for people to get work done. They provide a streamlined user experience that leads people through the processes their organization has defined for interactions that need to be advanced to a conclusion of some kind. This user experience can be tailored so that people with different security roles can have an experience that best suites the work they do by using Microsoft Dynamics CRM 2013 and Microsoft Dynamics CRM Online.

Use business process flows to define a set of steps for people to follow to take them to a desired outcome. These steps provide a visual indicator that tells people where they are in the business process. Business process flows reduce the need for training because new users don’t have to focus on which entity they should be using. They can let the process guide them. You can configure business process flows to support common sales methodologies that can help your sales groups achieve better results. For service groups, business process flows can help new staff get up-to-speed more quickly and avoid mistakes that could result in unsatisfied customers.

2. What can business process flows do?

With business process flows, you define a set of stages and steps that are then displayed in a control at the top of the form.

Business Process Flows1

Each stage contains a group of steps. Each step represents a field where data can be entered. People advance to the next stage by using the Next Stage button. You can make a step required so that people must enter data for the corresponding field before they can proceed to the next stage. This is commonly called ”stage-gating”.

Business process flows appear relatively simple compared to other types of processes because they do not provide any conditional business logic or automation beyond providing the streamlined experience for data entry and controlling entry into stages. However, when you combine them with other processes and customizations, they can play an important role in saving people time, reducing training costs, and increasing user adoption.

Business process flows integrated with other customizations:  When you or your user enters data using business process flows, the data changes are also applied to form fields so that any automation provided by business rules or form scripts can be applied immediately. Steps can be added that set values for fields that are not present in the form and these fields will be added to the Xrm.Page object model used for form scripts. Any workflows that are initiated by changes to fields included in a business process flow will be applied when the data in the form is saved. If the automation is applied by a real-time workflow, the changes will be immediately visible to the user when the data in the form is refreshed after the record is saved.

Although the business process flow control in the form does not provide any direct client-side programmability, changes applied by business rules or form scripts are automatically applied to business process flow controls. If you hide a field in a form, that field will also be hidden in the business process flow control. If you set a value by using business rules or form scripts, that value will be set within the business process flow.

System business process flows: Microsoft Dynamics CRM 2013 and Microsoft Dynamics CRM Online include three business process flows. To understand how business process flows work, review these system business process flows:

  • Lead to Opportunity Sales Process
  • Opportunity Sales Process
  • Phone to Case Process

These business process flows are provided so that people who are using Microsoft Dynamics CRM Online and who used the processes that were released with the Microsoft Dynamics CRM December 2012 Service Update will be able to upgrade and continue to use those processes. The processes included in the Microsoft Dynamics CRM December 2012 Service Update were hard-coded and included some capabilities that are not found in the business process flows you can create.

3. Multiple entities in business process flows:

You can use a business process flow for a single entity or span multiple entities. For example, you may have a process that begins with an opportunity, then continues to a quote, an order, and then an invoice, before finally returning to close the opportunity.

You can design business process flows that tie together the records for up to five different entities into a single process so that people using Microsoft CRM can focus on the flow of their process rather than on which entity they are working in. They can more easily navigate between related entity records.

4. Multiple business process flows are available per entity:

Not every user in an organization may follow the same process and different conditions may require that a different process be applied. You can have up to 10 active business process flows per entity to provide appropriate processes for different situations.

Control which business process flow will be applied: You can associate business process flows with security roles so that only people with those security roles can see or use them. You can also set the order of the business process flows so that you can control which business process flow will be set by default. This works in the same way that multiple forms for an entity are defined.

When someone creates a new entity record, the list of available activated business process flows is compared to the business processes flows that the person’s security role will show them. The first activated business process flow in that list is the one that will be applied by default. If more than one active business process flow is available, people can chose Switch Process from the command bar to apply a different process. Whenever someone switches processes, the current process stage will be set to the first stage of the newly applied business process flow.

Each record can have only one business process flow at a time. When any user applies a different process, that process is the one that the next user to view the record will see. If someone’s security roles do not allow them to use a specific business process flow, the current business process flow will be visible, but disabled.

5. Business process flow limitations:

You can define business process flows only for those entities that support them. You also need to be aware of the limits for the number of processes, stages, and steps that can be added.

Entities that can use business process flows: Only entities that use the updated forms can use business process flows. This includes custom entities and the following system entities:

Account

Appointment

Campaign

Campaign Activity

Campaign Response

Competitor

Contact

Email

Fax

Case

Invoice

Lead

Letter

Marketing List

Opportunity

Phone Call

Product

Price List Item

Quote

Recurring Appointment

Sales Literature

Order

User

Task

Team

To enable a custom entity for business process flows, select the Business process flows (fields will be created) check box in the Entity definition.

Note: You cannot undo this action.

Maximum number of processes, stages, and steps: To ensure acceptable performance and the usability of the user interface, there are some limitations you need to be aware of when you plan to use business process flows:

  • There can be no more than 10 activated business process flow processes per entity.
  • Each process can contain no more than 30 stages.
  • Multi-entity processes can contain no more than five entities.

6. Configure business process flows:

Business process flows use the same technology as other types of processes. The process to create them is similar, but configuring them is very different.

Create business process flows:
There are two ways you can view, create, or edit business process flows:
1. Click on  Microsoft Dynamics CRM->Settings -> Processes
Business Process Flows2
2. In the default solution-> using the solution explorer->click on Processes
Business Process Flows3
Like other processes, business process flows have the following properties in the ‘Create Process’ dialog:
Business Process Flows4
Process name: The name of the process does not need to be unique, but it should be meaningful for people who need to choose a process. You can change this later.
Category: This property establishes that this is a business process flow process. You can’t change this after you save the process.
Entity: Choose one of the entities from the list of business process–enabled entities. If you don’t find the entity you expect, make sure the entity has the Business process flows (fields will be created) option set in the entity definition. You can’t change this after you save the process.
Note: Business process flows have a simplified way to reuse existing business process flows as an advanced starting point for new business process flows. When you select Business Process Flow as the Category, there is no option available to set the Type value as you can for other types of processes. Instead, when you open an existing business process flow, you will find a Save As button on the command bar. This will create a new business process flow that is the same as the existing one, except that the text (Copy) will be appended to the name.

After you create a new business process flow, the Create Process dialog box will close and you must find the new process in the list and open it.

Edit business process flows: Once you open a business process flow to edit it, you will see the following page:
Business Process Flows5
If you want to rename the process or add a description, you must click or tap the Expand toggle to view these properties. When you define the logic for a business process flow, you will edit stages and steps, and add additional entities.

Edit Stages: Business process flows can have up to 30 stages. To add a stage, click or tap the (+) icon near the Stages column. To remove a stage, select it and click or tap the X icon on the right edge of the stage. Stages have a label that you can set. The text of the label is always in upper case.

Stages also have a Stage Category. This is optional. Stage category is useful for reports that will group records by the stage they are in. The options for the stage category come from the Stage Category global option set. You can add additional options to this global option set and change the labels of existing options if you want. You can also delete these options if you wish, but we recommend that you keep the existing options. You won’t be able to add the exact same option back if you delete it. If you don’t want them to be used, change the label to ”Do not use”.

Edit Steps:  When you have selected a stage, click or tap the (+) icon near the Steps column to create a new step. To remove a step, select it and click or tap the X icon on the right edge of the step.

Each step has a label set to New Step when you create it. When you set the field for the step, if you haven’t edited the label, the label for the step will change to match the label for the field. Generally, you want the label for the step to match the label for the field. Once you edit the label, it will not change when you change the field.

Add Additional entities: In the Included Entities area, you can select Options to see available options to Add Entity or Close Process Cycle

Business Process Flows6

You can add any of the entities that have one-to-many relationships with the entity selected for the process. After you add an entity, you can select any of the entities that have a one-to-many relationship with that entity. You can add up to five entities, but each entity you add can only proceed to one of the entities that have a one-to-many relationship with the previous entity. If an entity doesn’t have any one-to-many relationships, your only option is to close the process cycle.

Closing the process cycle is always the last stage of the flow. You can close the cycle by using any of the entities in the cycle. This is frequently a step to change the state of the original entity, but you may choose a different entity.

Remove Additional entities: After you have added an additional entity in Options, you will see a new Deleted Last Entity option. Because each entity you add depends on the previous entity, when there are multiple entities, you need to remove them in the reverse order in which they were added.

To make a business process flow available for people to use, you must order the process flow, enable security roles, and activate it.

Set Order: When you have more than one business process flow for an entity, you need to rank the order in which they should be evaluated to be used by default. To open a dialog where you can move business process flows up or down, in the command bar, select Order Process Flow. For new records or records that do not already have a process flow associated with them, the first business process flow that a user has access to is the one that will be used.

Enable Security Roles: People will only be able to use business process flows that are associated to security roles that are associated with someone’s user account. By default, only the System Administrator and System Customizer security roles can view a new business process flow. To set these roles, in the command bar, select Enable Security Roles. You can choose either the Enable for Everyone or Enable only for the selected security roles options. If you choose Enable only for the selected security roles, you can select which security roles will allow access to the business process flow.

Activate: Before anyone can use the business process flow, you must activate it. In the command bar, select Activate to open the Process Activate Confirmation dialog box. After you confirm the activation, the business process flow is ready to use. If a business process flow has errors, you will not be able to activate it until the errors are corrected.

Types of Processes in Dynamics CRM 2013

Processes are a group of features that you can use to define and enforce consistent processes for your organization. These consistent processes help make sure people using the system can focus on their work and not on remembering to perform a set of manual steps. Processes can be simple or complex and can change over time. Microsoft Dynamics CRM provides several options to define your processes. You need to understand how you can use each type to get the results you need.

Processes are designed to be used by people who aren’t developers. The rules that are defined in processes contain similar logic that a developer may apply using code, but you don’t need to call in a developer each time you want to change the rules. However, you do need to have a clear understanding of the logic in the rules and understand the capabilities of each type of process. You still need to apply processes carefully and test the results to make sure you get what you want.

The following table provides an overview of when to use each category of process in Dynamics CRM 2013.

Process Category Description
Workflow Use workflows to automate business processes behind the scenes. Workflows are typically initiated by system events so the user doesn’t need to be aware that they are running, but they can also be configured for people to manually initiate them.Workflows can operate in the background (asynchronously) or in real-time (synchronously). These are referred to separately as background workflows or real-time workflows.
Dialogs Use dialogs to create a user interface that will guide people through a script for customer interaction or a wizard to perform complex actions consistently.
Actions (Plugins) Use actions to expand the vocabulary available for developers to express business processes. With core verbs like Create, Update, Delete, and Assign provided by the system, a Action uses those core verbs to create more expressive verbs like Approve, Escalate, Route, or Schedule. If the definition of a business process changes, someone who isn’t a developer can edit the Action so the code doesn’t need to be changed.
Business Process Flows Use business process flows to define the steps in which people should enter data to achieve an outcome. Business process flows add a control to the top of a form that show people what data they need to enter to move forward to the next stage and ultimately to completion of a business process. A business process flow can span multiple entities.

Note: Business process flows are different from other types of processes. All processes use the same underlying technology and information about them is stored in the Process entity. Business process flows have a different configuration experience and behavior compared to other types of processes.

How to create a new Process:

  1. Click on Dynamics CRM-> Settings tile
  2. Click on Settings-> Processes tile
  3. Click on ‘New’ button to create a process and select the category, check out in the below screenshot.

Create New Process

What can processes do?

Processes are user-owned, just like accounts and contacts. The actions that can be performed by the process sometimes depend on the privileges of the person who owns the process and sometimes based on the context of the person who is initiating the workflow.

Processes can check conditions, apply branching logic, and perform actions. They perform these actions in a series of steps. Business process flows contain stages and control advancement to stages, but they don’t provide any of the other capabilities. The following table describes the available steps in workflow, dialog, and action processes. For more detail see the topics for each type of process.

Step Process type Description
Stage Workflow, Dialog, Action Stages make the workflow logic easier to read, and explain the workflow logic. However, stages don’t affect the logic or behavior of workflows. If a process has stages, all the steps in the process must be contained with a stage.
Check Condition Workflow, Dialog, Action A logical “if-<condition> then” statement.

You can check values for the record that the workflow is running on, any of the records linked to that record in an N:1 relationship, or any records created by earlier steps. Based on these values you can define additional steps when the condition is true.

Conditional Branch Workflow, Dialog, Action A logical “else-if-then” statement, the editor uses the text “Otherwise, if <condition> then:”

Select a check condition you have previously defined and you can add a conditional branch to define additional steps when the check condition returns false.

Default Action Workflow, Dialog, Action A logical “else” statement. the editor uses the text “Otherwise:”
Select a check condition, conditional branch, wait condition, or parallel wait branch that you have previously defined and you can use a default action to define steps for all cases that don’t match the criteria defined in condition or branch elements.
Wait Condition Background Workflow Only Enables a background workflow to pause itself until the criteria defined by the condition have been met. The workflow starts again automatically when the criteria in the wait condition have been met.
Parallel Wait Branch Background Workflow Only Defines an alternative wait condition for a background workflow with a corresponding set of additional steps that are performed only when the initial criterion is met. You can use parallel wait branches to create time limits in your workflow logic. They help prevent the workflow from waiting indefinitely until the criteria defined in a wait condition have been met.
Assign Value Dialog, Action Sets a value to a variable or output parameter in the process.
Create Record Workflow, Dialog, Action Creates a new record for an entity and assigns values to attributes.
Update Record Workflow, Dialog, Action You can update the record that the workflow is running on, any of the records linked to that record in an N:1 relationship, or any records created by earlier steps.
Assign Record Workflow, Dialog, Action You can assign the record that the workflow is running on, any of the records linked to that record with an N:1 relationship, or any records created by earlier steps.
Send Email Workflow, Dialog, Action Sends an email. You can choose to create a new email message or use an email template configured for the entity of the record that the workflow is running on or any entities that have an N:1 relationship with the entity, or the entity for any records created by earlier steps.
Start Child Workflow Workflow, Dialog, Action Starts a workflow process that has been configured as a child workflow.
Change Status Workflow, Dialog, Action Changes the status of the record that the process is running on, any of the records linked to that record with an N:1 relationship, or any records created by earlier steps.
Stop Workflow/Stop Dialog Workflow, Dialog, Action Stops the current workflow, dialog, or action. You can set a status of either Succeeded or Canceled and specify a status message.
Page Dialog A container for prompt and response steps in a dialog.
Prompt and Response Dialog Displays a prompt in a dialog page and may provide a field to capture data from a response.
Query CRM Data Dialog Defines a query that returns data to provide options for a response in a prompt and response step of a dialog.
Link Child Dialog Dialog Starts a dialog process that has been configured as a child dialog.
Custom Step Workflow, Dialog, Action Provides extensions to the logical elements available by default in CRM. Steps can include conditions, actions, other steps, or a combination of these elements. Developers can create custom workflow steps. By default, there are no custom steps available in CRM.

Are processes active when they are imported?

Processes operate after they are activated. Generally, when you import a solution that will create a new process in your organization, the state of that process in your organization depends on the state of the process when the solution was created. This is true for all solutions that were exported from a Microsoft Dynamics CRM 2013 or Microsoft Dynamics CRM Online organization after the Microsoft Dynamics CRM Online Fall ‘13 release. If the solution was created using a Microsoft Dynamics CRM 2011 or Microsoft Dynamics CRM Online organization before Microsoft Dynamics CRM Online Fall ‘13, the solution will be activated when you install the solution.

Sometimes you must re-install a solution or install an update to a solution that contains processes. In this case, the state of the process in your organization won’t change.