Creating a mandatory Reason Lost field for lost opportunities using a validation rule
In this recipe, we will create a validation rule that ensures that an explanation is provided whenever an opportunity is set to Lost.
To store the reason for the lost opportunity, we will create a custom field called Reason Lost (which we will name Reason_Lost__c
). This will be created and checked using a validation rule.
Getting ready
Carry out the following steps to create a custom Reason Lost field on the opportunity object:
- Click on the Setup gear icon in the top right-hand corner of the main Home page, as shown in the following screenshot:
- Click the
Setup
option, as shown in the following screenshot:
- Navigate to the Opportunity customization setup page by clicking the following:
Objects and Fields
|Object Manager
|Opportunity
|Fields & Relationships
.
Locate the Fields & Relationships
section on the right of the page.
- Click on
New
.
You will be presented with the Step 1. Choose the field type
page...