Home » Dynamics » Make the Business Process Flow fields to be required conditionally

Make the Business Process Flow fields to be required conditionally

Text Widget

This is a text widget. The Text Widget allows you to add text or HTML to your sidebar. You can use a text widget to display text, links, images, HTML, or a combination of these. Edit them in the Widget section of the Customizer.

Introduction:

Recently, we had a business requirement to make some fields, present in the Business process flow stage, to be required conditionally based on the value selected in one of the fields in the BPF stage.

First, we tried to achieve this by writing a client side JavaScript code to make the Business Process fields required based on the value selected in particular field.

But JavaScript won’t work! We tried to use ‘setRequiredLevel’, but this method doesn’t work for the fields present in the Business Process Flow even though we use ‘header_process_’ to get the fields.

Using the Branching functionality of Business Process Flow:

Finally, we decided to use the branching functionality of BPF which was introduced in Dynamics CRM 2015.

The logic is to have two stages with the same structure. The only difference would be that one stage will have the fields as required & another stage will have the fields as optional and switch these stages based on the value selected in the particular field.

We have a condition to check the value selected in field 1 of stage 1. If the field value is true then show Stage2 with Field 2 as required else show Stage 2 with Field 2 as optional, as seen in the image below;

Make the Business Process Flow fields to be required conditionallyHere, we have two stages for Stage 2. Everything will be a same, i.e., the name of the stage, number of fields, etc. except one will have the field as required and other will have the field as optional.

Below is the example of the Business Process flow designer where you can see that we are conditionally showing the same stages but with different field requirement levels.

To create the same stage we just copied the stage.

Make the Business Process Flow fields to be required conditionally

Note:

Each stage in the BPF has their own unique GUID. So in the above case where we have two same stages, the stage name would be the same, but the GUID of two stages would be different.

Integrate Intuit QuickBooks & Microsoft Dynamics 365 with InoLink

from Microsoft Dynamics 365(CRM) Tips and Tricks http://bit.ly/2wIQutt
via IFTTT


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: