Configure the System
Learning Objectives
After completing this unit, you’ll be able to:
- Create custom fields for recording competitor information.
- Add validation rules to ensure your sales reps populate the new fields.
Create a Competitor Custom Field
Let’s begin by creating two new custom fields on the Opportunity object, Competitor and Lost Reason. Although there is a similar standard field on the Opportunity object called Main Competitor(s), we are going to create a new picklist field instead. Plain text fields are fairly challenging to analyze since users will likely enter similar values for the same competitor. Picture one user entering "Acme" as a competitor, another user entering "Acme Inc.", and yet a third user entering "Acme Industries" - it will lead to messy and inconsistent data about competitors. For this reason, we recommend creating a new picklist field with pre-defined values.
Here’s how to create the first custom field.
- Click and select Setup. This launches Setup in a new tab.
- Click Object Manager.
- Click Opportunity, then Fields & Relationships.
- At the top of the Fields & Relationships page, click New.
- Select Picklist, and click Next.
- For Field Label, enter
Competitor
. - Select Enter Values with each value separated by a new line.
- In the text box, list your main competitors on separate lines.
- Make sure Restrict picklist to the values defined in the value set is selected.
- In Help Text, offer your users a useful tip about this new field:
Identify the primary competitor for this opportunity
. - Click Next.
- Set the field-level security. Make sure that sales reps and other contributors can edit and update the opportunity values. For example, give edit access to sales reps and managers by selecting Visible for Custom:Sales Profile and Contract Manager.
- Click Next.
- Select the page layouts that should include the new field, such as any page layouts assigned to the profiles of your sales organization.
- Click Save.
Create a Lost Reason Field Custom Field
- Repeat steps 1–5 above to create a second new picklist field on the Opportunity object, then add the following details.
- For Field, enter
Lost Reason
. - Select Enter Values with each value separated by a new line.
- In the text box, on separate lines list the key reasons that deals might have been lost, such as Price, No Decision, Product Gap, Financial.
- Make sure Restrict picklist to the values defined in the value set is selected.
- In Help Text, offer your users a useful tip about this new field:
Select the primary reason this opportunity was lost. This field is only required when closing an opportunity as Closed Lost
. - Click Next.
- Set the field-level security.
- Click Next.
- Select the page layouts that should include the new field.
- Click Save.
Create a Competitor Validation Rule
Now that you’ve got the two new fields, you can create validation rules to ensure your sales users populate them at the right time in the sales cycle.
Here, we give you steps to enforce this rule only when the opportunity reaches any of these stages in the sales cycle: Proposal / Price Quote, Negotiation / Review, Closed Won, and Closed Lost.
- Click and select Setup.
- Click Object Manager.
- Click Opportunity, then click Validation Rules.
- At the top of the Validation Rules page, click New.
- For the Rule Name, enter
Competitor Required
. Salesforce automatically inserts “_” between the words. - Make sure that Active is checked.
- Copy and paste the following formula into the Error Condition Formula text box.
(ISPICKVAL( StageName , "Proposal/Price Quote") || ISPICKVAL( StageName , "Negotiation/Review") || ISPICKVAL( StageName , "Closed Won") || ISPICKVAL( StageName , "Closed Lost")) && ISBLANK( TEXT(Competitor__c ))
- For Error Message, enter
Competitor field requires a value before advancing to this Opportunity stage
. - For Error Location, select Field, and then choose Competitor from the picklist.
- Click Save.
Create a Closed Lost Validation Rule
Next, build out the second validation rule with slightly different requirements. When sales loses an opportunity, it’s important to understand why. Here’s how to create a rule that ensures users populate the new Lost Reason field whenever they change the stage to Closed Lost.
- Click and select Setup.
- Click Object Manager.
- Click Opportunity, then click Validation Rules.
- At the top of the Validation Rules page, click New.
- For Rule Name, enter
Lost Reason
. The system automatically inserts “_” between the words. - Make sure that Active is checked.
- For Error Condition Formula, to check for any Closed Lost stage names, paste the following text into the text area.
AND(ISBLANK(TEXT(Lost_Reason__c)), ISPICKVAL( StageName , "Closed Lost"))
- For Error Message, enter
Lost Reason field requires a value when the stage is Closed Lost
. - For Error Location, select Field, and then choose Lost Reason from the picklist.
- Click Save.
Test It Out
This is a good place to stop and test your changes. Try walking through the experience as if you're a sales rep. For example, create a new opportunity. Do you see the new Competitor and Lost Reason fields on the page? Enter the Proposal / Price Quote stage. Does that trigger the Competitor field? How about Negotiation / Review, Closed Won, and Closed Lost? And, when you change the stage to Closed Lost, is the Lost Reason field required? When you're satisfied with the behavior of the rules you’ve set up, you’re ready to build some reports. We do that next.
Resources
- Create Custom Fields (Salesforce Help Article)
- Validation Rules (Salesforce Help Article)