Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I'm new to coding in Salesforce and I'm trying to code the following logic:

If a certain picklist value is chosen, another certain field cannot be left blank.

I wrote the following but I'm not sure what's wrong:

IF((ISPICKVAL(Stage,"Lost")), ISBLANK( Reason_Lost)).

Can someone please explain to me what I'm doing wrong?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

Can you please try the formula AND( ISPICKVAL(Stage, 'Lost') , ISBLANK( TEXT(Reason_Lost__c)))

EDIT:updated my answer as you told Reason_Lost field is Picklist

share|improve this answer
    
Thank you, that works too! –  Dezzie Apr 7 at 15:14

IF(AND((ISPICKVAL(Stage,"Lost")), ISBLANK( Reason_Lost)),TRUE, FALSE)

share|improve this answer
    
I get the error that the field 'Reason_lost' is a picklist field. Is there a function I can use to check if it's empty or not that is the equivalent of 'ISBLANK'? –  Dezzie Apr 7 at 15:08
    
IF(AND((ISPICKVAL(Stage,"Lost")), ) ISPICKVAL(Credit_Card__c," "), TRUE, FALSE) –  Kiran Mutturu Apr 7 at 15:13

AND((ISPICKVAL( StageName ,"Closed Lost")), ISBLANK(TEXT( Reason_Lost__c )))

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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