I had an interesting request from one of my clients today, and I thought the solution would be a great quick blog post for other Salesforce Administrators. The request was to enforce Users to create an Opportunity during the Lead Conversion process (for marketing reporting).
You can accomplish this with a Lead Validation Rule. Remember that when you write a Validation Rule, when the logic holds TRUE, you can block the record from being saved and display an error message.
The syntax for our Validation Rule is as follows:
Broken down, for the Validation Rule to work both of the following conditions must be true:
IsConverted=true – which checks to see if the Lead is being converted
Converted OpportunityID="" – which checks to see if an Opportunity was created
Here is a screenshot of how to setup the Validation Rule on Leads:
And here is the result when the Validation Rule blocks the Lead record during the conversion step:
Here is another example you might find useful. This Validation Rule on Leads makes Lead Source required before being converted (again, Validation Rules must result in TRUE to fire). Here is the syntax:
That’s it! A nice little tip to enforce data quality and compliance.