Scenario 1

Michael is a sales manager for Contoso Corporation and is worried about the state of sales management in Contoso. He has noticed that the sales representatives make frequent changes to the leads created in the system during the Qualify stage of a lead. This gives him issues about the data of leads that he reports daily, and the company forecasts are struggling. Michael wishes to lock the editing of the leads by the sales representatives once a lead is created in the Develop stage. So, the only time a sales representatives can enter information about a lead is during the first-time entry. If they wish to make changes to the leads later, they need to contact Michael.

The following steps illustrate how Michael can utilize out-of-box workflows to achieve this requirement:

  1. The first step will be to navigate to Settings | Processes:
  1. Click on the New button on the Processes entity grid ribbon that you see:
  1. The Create Process window will pop up. Select Category as Workflow, untick the checkbox for Run this workflow in the background (recommended), which is selected by default, and select Entity as Lead:
  1. The Create Process window will pop up. Select Scope to Organization so that it is applicable to all of the users of the CRM system. Other options available for scope are those that are applied as per the security model configured in the CRM system:
    • Users
    • Business Unit
    • Parent Child Business Unit

Also, select the checkbox for On fields Change and click Select:

  1. The Select Fields option will pop up, as shown in following image. Select all of the fields available. This selection is used to configure the trigger for the workflow. In this configuration, a workflow will be triggered for all of the field changes. Other triggers available for the workflow are as follows:
    • Record is Created
    • Record Status change (from Active to Inactive, or vice versa)
    • Record is Assigned
    • Record is Deleted

Once the required fields are selected, click OK:

  1. The next step is to configure what needs to happen every time fields change on the lead record.

Scroll down a bit on the workflow editor window and you will be able to see the Add Step button. On the available menu, select Check Condition.

This part allows us to select what actions or automation need to be applied once the event is selected in the workflow is triggered. The main steps that can be used are as follows:

Check out the following screenshot:

Now, click on Add Step. After clicking Add Step, you will be presented with an area to comment about the step. It is recommended that you use this area to describe the current step. Then, click the condition area below that:

Select the conditions for this workflow action to be triggered. In our case, the conditions for the current process stage category are Qualify and Modified by (User) (user modifying the record), which are created by the user or the sales representative for the configuration applied in Contoso corporation's CRM system. Once done, click Save and Close:

Navigating back to the steps flow, select the next available step row below the condition, click Add Step again, and select the Stop Workflow step:

On the next step, select the dropdown for the status of the stopping workflow. The default value will be Succeeded; change that to Canceled. Also, do not forget to mention some meaningful comments about this step. Click Set Properties:

  1. Mention a meaningful message for the status and click Save and Close:
  1. On the top of the workflow, note that there is a button to Activate the workflow. Once activated, this workflow will start working:
  1. On confirmation, a pop-up window will appear; click Activate:

The following error will pop up to the user because of this workflow:

Let's now see this workflow in action. Navigate to any leads created by the sales representative in the system and try to edit an existing lead during the Develop stage. You will receive the preceding error.

Using the synchronous workflow along with the validation available to identify the stage category has enabled Michael to lock multiple edits to the lead record, thereby improving lead management more effectively.