Making a Field Read-only On a Business Process Flow

David Mochrie, 11 February 2016

Dynamics CRM Business Process Flows (BPFs) can be very useful for guiding users through business processes in CRM. One limitation of a BPF is that fields on them can’t be made read only simply by making the field read only on the form. There is however a code-free way round this using business rules.

You may be wondering why you would ever want to make a field read only on a BPF. After all, BPFs are basically checklists, and what use is a checklist if you can’t complete it. Well, consider this scenario: - you have a process for on-boarding contacts into your Dynamics CRM. One of the steps of this process is to verify the identity of the contact. The company’s policy states that you can do this by sighting either their passport, driver’s license or birth certificate. It doesn’t matter which one, as long as you see one of them. The company also want to record in CRM which of the documents were sighted. So, users can’t simply tick an ‘Identity verified’ box, they have to be forced to specify which document they saw.

The company has 3 stages to its contact on-boarding process:

  1. Identify
  2. Develop
  3. Close

image

The verification of the contact’s identity is in the first stage. Company policy says you can’t move to the ‘Develop’ stage until you’ve confirmed the contact’s identity.

So, how do we manage this?

First, we create 4 custom fields on the contact entity, of type ‘Two Options’:

  1. Birth Certificate
  2. Passport
  3. Driver’s License
  4. Identity Verified

We place the first 3 of those fields on the contact form. I’ve put them together in a section called ‘Identity Verification’ in the ‘Details’ tab.

image

If we simply added these 3 fields to the BPF in the ‘Identify’ stage and made them required on the BPF, this wouldn’t work, as the BPF would demand all 3 fields were set to yes before allowing a user to proceed. We need only one of them ticked to proceed. This is where the ‘Identity Verified’ field comes in.

We create a business rule which sets the ‘Identity Verified’ to ‘Yes’ when any one of the 3 fields is set to yes.

image

We put that ‘Identity Verified’ field on the first stage of the BPF as a required field.

image

So far so good.

But wait. What’s to stop the user from setting the ‘Identity Verified’ field to ‘Yes’ on the BPF without actually saying which document was sighted? We do this with another business rule which sets the ‘Identity Verified’ to ‘Locked’ if ‘Last Name’ contains data.

image

As ‘Last Name’ is required, it will always contain data, so ‘Identity Verified’ will always be locked. It’s this business rule setting the ‘Identity Verified’ field to locked which sets the field as locked on the BPF. As I said before, it’s not enough to make the ‘Identity Verified’ field read only on the form. It has to be done with the business rule.

Now, when create a new contact, we enter the ‘Last Name’ and the ‘Identity Verified’ field becomes locked.

image

The user is then forced to state which document was sighted in order to move to the next stage of the BPF. You could even add the 3 identify verification fields to the ‘Identify’ stage on the BPF as well, to keep all your fields in one place for ease of data entry, just don’t set them as required.