function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Peter Russell 9Peter Russell 9 

How to make a lead field compulsory when converting to opportunity

Hi,
I would like to know how I can make a field on the lead screen compulsory when converting to an opportunity? 

The method of making a field compulsory on just the lead screen wont work. Ideally, when convert is pressed, it will reject the conversion until the field has been selected (dropdown list).

Thanks,
Peter 
 
Waqar Hussain SFWaqar Hussain SF
Hi Peter, 

You can use validation rule to make field required for converting leads.

See example of validation formula
ISCONVERTED = TRUE
&&
OR(
ISBLANK( Phone ),
ISBLANK(Website )
)

 
Peter Russell 9Peter Russell 9
Hi,
 
Thanks for the response. I am receiving an error "Error: Field Customer_Disposition__c is a picklist field. Picklist fields are only supported in certain functions."

Would it just be a case of changing ISBLANK to Not Equal To 'Value 1' 'Value 2' etc? Where value equals the options in the picklist?

If so, what would the code be for this?

Thanks,
Peter 
 
Waqar Hussain SFWaqar Hussain SF
Use below code instead
ISCONVERTED = TRUE
&&
OR(
NOT(ISPICKVAL(Customer_Disposition__c, "Value 1")),
NOT(ISPICKVAL(Customer_Disposition__c, "Value 2"))
)

 
Peter Russell 9Peter Russell 9
Hi,
Thank you. It works when amending the fields of the lead but not when converting - sometimes my users won't amend a lead (online enquiry) and will just convert it straight away, is there any way to stop it converting (when they haven't amended anything) unless that particular field is completed?
Thanks!
Waqar Hussain SFWaqar Hussain SF
Try below code
 
AND( IsConverted, OR( NOT( TEXT( PRIORVALUE(Customer_Disposition__c))  = "Value 1"), NOT( TEXT( PRIORVALUE(Customer_Disposition__c))  = "Value 2") )
)

 
Peter Russell 9Peter Russell 9
Hi, I am using the below but getting an error that a ')' is missing.

AND( IsConverted, OR( NOT( TEXT( PRIORVALUE(Customer_Disposition__c)) = "Ready to pay"), NOT( TEXT( PRIORVALUE(Customer_Disposition__c)) = "Wants free advice"), NOT( TEXT( PRIORVALUE(Customer_Disposition__c)) = "Wants time to think"), NOT( TEXT( PRIORVALUE(Customer_Disposition__c)) = "Fee too high") )
2
)
Waqar Hussain SFWaqar Hussain SF
AND( IsConverted, OR( NOT( TEXT( PRIORVALUE(Customer_Disposition__c)) = "Ready to pay"), NOT( TEXT( PRIORVALUE(Customer_Disposition__c)) = "Wants free advice"), NOT( TEXT( PRIORVALUE(Customer_Disposition__c)) = "Wants time to think"), NOT( TEXT( PRIORVALUE(Customer_Disposition__c)) = "Fee too high") )
)

 
Peter Russell 9Peter Russell 9
Hi Waqar,

Thanks. For some reason it still isn't working, it allows me to convert a lead without setting a value. The syntax checker displays no errors. In fact, I have just tested after amending other fields in the lead and it allows me to save and convert. 

Thanks,
Peter 
Waqar Hussain SFWaqar Hussain SF
Hi Peter, 

Sorry for the delayed response. 

Please see the following articles, to run validation rule on lead convert, you will have to check require validation for converted leads checkbox from the lead setting. 

https://help.salesforce.com/articleView?id=000176187&type=1
https://help.salesforce.com/articleView?id=Enabling-Use-Apex-Lead-Convert&language=en_US&type=1