Dynamics CRM 2013 – Workflow Processes (Part 2)

This post is in continuation with the previous blog post Dynamics CRM 2013 – Workflow Processes (Part 1)

In this post:

Workflow stages and steps

Actions that workflow processes can perform

Setting record values

Setting conditions for workflow actions

Workflow stages and steps

  • While designing workflows you have the option to contain the workflow steps in stages

  • Stages

    • Makes the workflow logic easier to read

    • Explain the workflow logic

    • Do not affect the logic or behavior of workflows

    • If a process has stages all the steps within the process must be contained within a stage

  • Steps

    • Are a unit of business logic within a workflow

    • Steps can include conditions, actions, other steps or a combination of these elements

Actions that workflow processes can perform

Workflow processes can perform the actions listed in the following table (See figure 1 below)

Action

Description

Create Record

  • Creates a new record for an entity you choose and assigns values

Update Record

  • You can update

    • The record that the workflow is running on

    • Any of the records that are related to current record with an N:1 relationship

    • Any records created by earlier steps

Assign Record

  • You can assign

    • The record that the workflow is running on

    • Any of the records that are related to current record with an N:1 relationship

    • 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

    • any entities that have an N:1 relationship with the entity

    • 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 that are related to current record with an N:1 relationship

    • Any records created by earlier steps

Stop Workflow

  • Stops the current workflow

  • You can set a status of either Succeeded or Canceled and specify a status message

Custom Step

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. For more information for developers, see the Microsoft Dynamics CRM SDK topicCustom workflow activities (workflow assemblies).

Actions that workflow processes can perform

1. Actions that workflow processes can perform

Setting record 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 top portion of the form

  • 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

  • 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

    • 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. So;

    • 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.

Setting record values

2. Setting record values

Setting conditions for workflow actions

  • The actions that you will apply may depend on conditions

  • 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 on

    • Any of the records linked to that record with N:1 relationship

    • Values within the process itself (See figure 1 above)

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 related to the current record with an N:1 relationship

    • 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

  • You can add a conditional branch to define additional steps when the check condition returns false

Default Action

  • A logical “else” statement

  • To add a Default action in the workflow logic, select a check condition, conditional branch, wait condition, or parallel wait branch that you have previously defined

  • 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

  • Enables a background workflow to pause itself until the criteria defined by the condition have been met

  • Workflow starts again automatically when the criteria have been met

  • Real-time workflows can’t 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

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. For more information for developers, see the Microsoft Dynamics CRM SDK topicCustom workflow activities (workflow assemblies).


Reference:Microsoft Dynamics CRM 2013 Implementation Guide

Video: Dynamics CRM 2011 Creating Workflows

(Video is although from 2011 version but comprehensive. Covering almost all the aspects of Workflows in Dynamics CRM 2013 except Real-time workflows.)

Advertisements
Tagged with: , , , , , ,
Posted in Dynamics CRM, Dynamics CRM - Customization and Configuration
One comment on “Dynamics CRM 2013 – Workflow Processes (Part 2)
  1. […] Dynamics CRM 2013 – Workflow Processes (Part 2) […]

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: