3

I'm trying to get this validation rule on Opportunity to fire off whenever StageName = 'Decline to Bid' AND either Lost_Reason__c(Picklist) is blank OR Lost_Details__c(Text) is blank. In other words, Lost Reason and Lost Details must be filled in when the StageName changes to 'Decline to Bid'. Here's what I got so far:

AND(
ISPICKVAL(StageName,'Decline to Bid'),
ISBLANK(TEXT(Lost_Reason__c)),
ISBLANK(Lost_Details__c)
)

Any ideas what I'm doing wrong?

Thank you!

Edit: I tried the formula provided by Suri, not working. Made sure there're no blank spaces and no typos. The rule is active.

Criteria 1

Criteria 2

12
  • is this field a picklist Lost_Reason__c – Suresh Jun 12 '15 at 17:52
  • @Suri Yes it is. – humanoid Jun 12 '15 at 17:54
  • silly question, is the rule active? – Rao Jun 12 '15 at 17:55
  • @rao Yes the rule is active. – humanoid Jun 12 '15 at 17:59
  • 1
    Judging the the description in your question, wouldn't you want AND(ISPICKVAL(StageName,'Decline to Bid'), then OR(ISBLANK(TEXT(Lost_Reason__c)), ISBLANK(Lost_Details__c) ))? So that if either field is blank, the validation rule's triggered. – Alex S Jun 12 '15 at 18:50
4

So that the validation rule fires if either field is blank you'd need to use

AND(
ISPICKVAL(StageName,'Decline to Bid'),
OR(
ISBLANK(TEXT(Lost_Reason__c)),
ISBLANK(Lost_Details__c)
)
)
0
0

Do not validate multiple fields in a single validation rule, because this will look weird when the user triggers the rule. Your only choices are to put it at the top of the page, which won't highlight a specific field, or you can place it on either the reason or detail field, which will look weird when the value is populated but the message says it needs to be. Instead, use two rules to accomplish your task.

Rule #1:

AND(ISPICKVAL(StageName,'Decline to Bid'), ISBLANK(TEXT(Lost_Reason__c)))

Rule #2:

AND(ISPICKVAL(StageName,'Decline to Bid'), ISBLANK(Lost_Details__c))

Attach each rule to the correct field so the user can immediately see which field is in error when they are prevented from saving.

0

The formula should look like this, make sure the rule is active

AND(
ISPICKVAL(StageName,'Decline to Bid'),
ISPICKVAL(Lost_Reason__c,''),
ISBLANK(Lost_Details__c)
)
4
  • The op's rule looks fine too, you can use ISBLANK(text(picklist_field)) to validate if picklist value is blank – Rao Jun 12 '15 at 18:04
  • ya it looks like he is doing Typo error while refering to this value -->Decline to Bid – Suresh Jun 12 '15 at 18:06
  • @Suri Thanks but it's still not firing. Please see edits above. – humanoid Jun 12 '15 at 18:30
  • AND( ISPICKVAL(Lost_Reason__c,''), ISBLANK(Lost_Details__c) ) just to make sure there may be any problem with the stage name change the rule as in the comment, if it fires then check the API name and Decline to Bid picklist values are correct as you were refering – Suresh Jun 12 '15 at 18:50

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.