Creating and customizing task flows


In this post, I’ll show you how to create new task flows to enable your users to quickly accomplish key mobile business tasks.

Enabling task flows

A quick disclaimer before we begin: task flows have been released as a preview feature for Dynamics CRM Online 2016 Update only. For more information about preview features, see What are preview features and how do I enable them?

For task flows to show up on mobile devices you must first turn the feature on. Follow these steps:

  1. Go to Settings > Administration > System Settings.
  2. In the Previews tab, turn task flows on and accept the terms of use.

Now that task flows are enabled, let’s head over to the process grid. Go to Settings > Processes.

In order to surface task flows, we can create a new user view:

  1. Under System Views, select Business Process Flows.
  2. Click the Advanced Find icon: .
  3. Click Edit Columns.
  4. Click Add Columns.
  5. Select the Business Process Type field and move it just after the Category column.
  6. Save As: Business Process Flows w/ Type.

Validate that the view shows the correct information by going back to the processes grid and selecting the Business Process Flow w/ Type view under My Views. There should be a new column to help us distinguish between business flows and task flows. 

Notice the three out-of-the-box task flow experiences that are already present. You can duplicate and modify these out-of-the-box task-flows as you see fit:

  • Update Contact
  • Make Contact on Opportunity
  • After Meeting (cannot be duplicated)

(Note: Because of platform limitations, no new task flows can be created on the Appointment entity.) 

Designing our first task flow

For this example, we will create a quick opportunity update flow called Nurture Opportunity. In this scenario, Nancy just got out of a briefing on an opportunity she is actively working on and she wants to quickly add information and context to the opportunity without having to open many forms.

The key is to only include a subset of the fields that are most pertinent to the task at hand, and intelligently guide the users towards updating all useful information without them having to understand the underlying data model.

Our flow can look something like this:

 

Now that we have understood our scenario and created a rough flow for the process, let’s go ahead and create the task flow.

Creating our first task flow

From the process grid, click .

The Create Process dialog will open, enabling you to create different types of processes: Actions, Workflows, Dialogs and Business Process Flows.

  1. The first thing we will do is give the process a name. This name will appear to your users, so make it descriptive. In our example we will call it Nurture Opportunity.|
     
  2. Then we will select the process category. Task flows and business flows are both types of business process flows. Once you’ve selected Business Process Flow, a new radio button will appear allowing you to select task flows. For Category, select Business Process Flow.
     
  3. As with other processes, you can decide which entity acts as the primary entity. In short, you must define which entity acts as a starting point when launching task flows. In our example we will choose Opportunity.
     
  4. The Business Process Type control is new. By default, the process is configured to run as a business flow, i.e.. the classic experience you are already accustomed to. However, there is now a new format; you can run the process as a task flow. In that case it is only available for mobile users. Select Run process as a task flow (Mobile only).
     
  5. Finally, you will see a Name control just below. This is the logical name of the task flow for any custom client API needs. It is automatically populated; however, you may change it if needed.

Finally, click OK.

Configuring the task flow

After creating the new process, the task flow editor will automatically launch. The editor will feel very familiar as it re-uses some components of the current business flow editor.

You will notice that there is a Details section where you can find information on the current task flow, including:

  • Process Name: the name shown to users
  • Primary Entity: starting entity
  • Owner: creator of the process
  • Name: logical name used programmatically
  • Image: the image that will be used in the task flow menu and at the top of each page. There is a default image for all new task flows, but by clicking on Set Image, you can upload your own image if you wish to differentiate processes visually. (Note: pre-crop the image to 144×144 for best results.)

Pages

As you may notice, in task flows you will be working with pages, which share similarities with stages in business flows. In short, by adding fields to a page, you are simply configuring each page of your process. There are three areas of interest for each page:

  1. Page Label: which is the title users will see on each page as they traverse the flow.
  2. Page Information: which contains two un-editable fields: the primary entity and the logical name of the page. This information is useful for referring to that specific page using the client API (documentation currently not available).
  3. Control area: this section enables you to select the specific field that needs to be shown as well as the label. However, since task flows are multi-entity enabled, we also allow you to fetch fields from any related entities (relationship has to be N:1/Lookup) using the Source column. Finally, we have also included two special keywords as sources: Label and Section. These allow you to better organize the flow of information on your pages.

Branching

After configuring the first page, we need to determine what happens once the user clicks the Next button. Similarly to business flows, we can create a branching condition; however, now you can use the Source and Field controls to branch on almost any field of the primary OR related entities (N:1 relationships), and even compare values between entities (when Type equals Field).

 

Business rules

Furthermore, to automate actions, task flows have been enhanced with the flexibility of business rules. It is now possible to create a business rule on any field of the primary or related entities. Most actions of business rules are supported; these include:

  • Show error message
  • Set field value
  • Set business required
  • Set visibility
  • Set default value
  • Lock or unlock field
  • And a new action: Run Script. This new action enables you to trigger custom JavaScript directly from the business rule*

* Running a script directly from a PBL is available for task flows as a Preview only. The same Xrm.Page object model found in entity form pages is available. We are looking for feedback as to how you want to use this experimental capability. 

To create a business rule for our process, simply click Business Rules on the action bar:

From the dialog, you can create a new business rule. Note that the business rule will be scoped to only run on the task flow, i.e., you can’t set an entity-level scope from this business rule editor.

In our example, we will set a specific business rule to run that depends on the opportunity pipeline phase. First we set the condition, and as before, the condition can pull fields from the primary entity as well as any of the related N:1 entities using the Source and Field selectors.

Finally, we can configure the specific action taken when that condition is validated. In our case, we want to mark the Proposal Meeting field as Business Required. Again, we can use Source and Field to specifically target the control to be affected. 

Bringing it all together

Now that we understand the building blocks of a task flow, we can continue adding new pages, branching conditions and business rules to effectively create an easy to use process that our users can utilize to quickly accomplish their tasks without having to think about the underlying entity data model.

 

I hope this post effectively highlighted some of the new innovations in business processes and productivity. Task flows are being released as a preview feature in Dynamics CRM Online 2016 Update. We highly encourage you to try it out, and let us know what you think.

Other Resources

What are task flows and how do they compare to other tools in Dynamics CRM? 

What are preview features and how do I enable them?

Preview feature: Create a new task flow.

 

Regards,

Daniel Dallala | Twitter | LinkedIn

Comments (0)