2

In our Salesforce process, our Opportunities have a custom Picklist field called 'Vertical' to track the industry segment of each Opportunity. I'm trying to make this a required field.

I'd like to keep other validation rules active (e.g. ensuring the Account field is properly populated, and that the Record Owner is properly specified), so I'm hesitant to work around the issue by changing the Lead Setting disabling validation rules, required fields etc. upon conversion.

I created this Validation Rule:

ISPICKVAL(Vertical__c, "")

However, with this rule in place, attempting to convert a Lead fails because the 'Vertical' Picklist has not been assigned a value. I don't want to give the 'Vertical' Picklist a default value, as that defeats the purpose of having reps select the right Vertical for each Opportunity.

Is anyone aware of a way to make this a required field for reps without breaking the Lead Conversion process?

4

The way to work around this is to have

  1. A field on the Lead called Is_lead__c (boolean) - default true
  2. Map this field to an Opportunity field called is_originated_by_lead__c in the Lead Field mappings dialog
  3. Enhance your validation rule to be

    IF (ISPICKVAL(Vertical__c, "") &&  /* fld is blank */
        ISNEW()) &&                    /* on new Oppo */
        Is_originated_by_lead__c,      /* created by lead conversion */
        false,                         /* not an error */
        ISPICKVAL(vertical__c,"")      /* otherwise check fld presence*/
     )
    
| improve this answer | |
  • I did this and fail.This is my formula IF( OR(ISBLANK( TEXT(Business_Unit__c)),ISBLANK(Text( Business_Area__c )),ISBLANK(Text( Project__c ))) && ISNEW() && Created_from_Lead__c, False, OR(ISBLANK( TEXT(Business_Unit__c)),ISBLANK(Text( Business_Area__c )),ISBLANK(Text( Project__c ))) ) . It fail on after trigger .Anything I did wrong? – unidha Apr 15 '16 at 1:50
  • @unidha -- you should post as a new question with debug log excerpts – cropredy Apr 15 '16 at 17:25
  • I posted it here salesforce.stackexchange.com/questions/118102/… – unidha Apr 18 '16 at 3:03
0

If you want to prevent any specific valiadation rule the go can check below link. https://sfdceinstien.wordpress.com/2019/03/30/bypass-validation-rule-for-lead-conversion/ Mark this answer if it helps.

Thanks, Keerti Yadav

| improve this answer | |
  • please incldue the essentials of the link in the answers, thanks – glls Mar 30 '19 at 11:23
  • Welcome to SFSE Keerti. IT's ok to link tot external sites but we do expent the relevant content to be posted here too, as per the comments aboev. If you do that you'll find yourself earning points through upvotes, whereas answers like this are likely to get deleted by the community. Also, there's no need to ask people to accept or upvote answers, that's how this site works. – Matt Lacey Mar 31 '19 at 23:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.