Reply
Regular Contributor
Grifmang
Posts: 16
Accepted Solution

Closed - Lost to required field Reason Lost

Hey there all. I'm trying to create a validation rule, that says when an Opportunity Stage is set to Closed - Lost, then a required field comes up "Reason Lost". This is what I have as of now, and it is not working ..

 

 

AND ( OR ( ISPICKVAL( StageName, "Closed Lost")), ISNULL(Reason_Lost__c ) )

 Thanks for all the help.

 

Super Contributor
Stevemo
Posts: 3,210

Re: Closed - Lost to required field Reason Lost

[ Edited ]

Here's one that I wrote for my SFDC.Org, you don't have to evaluate the Oppotyunity Stage, you can use the IsClosed and IsWon fields, which makes it a lot easier if your SFDC.Org has multiple Sales Processes.

 

 

 

AND (IsClosed ,

NOT(IsWon),

ISPICKVAL( Loss_Reason__c ,""))

 

 my Loss Reason field is a Picklist , but you can use LEN, ISBLANK, or ISNULL if you have a Text Field

 

AND (IsClosed ,

NOT(IsWon),

LEN(Loss_Reason__c) < 1)

 

AND (IsClosed , NOT(IsWon),

ISNULL(Loss_Reason__c))

 

AND(IsClosed,

NOT(IsWon),

ISBLANK(Loss_Reason__c))  

 

 

 

 

Message Edited by Stevemo on 02-24-2010 03:41 PM
"If you're in a band and you think that you're good, you probably suck. If you're in a band and you think that you suck, you probably do." - Bob Pollard
Regular Contributor
Grifmang
Posts: 16

Re: Closed - Lost to required field Reason Lost

Ok Thanks Steve, I'll check it out, and mark accordingly.
Regular Contributor
Grifmang
Posts: 16

Re: Closed - Lost to required field Reason Lost

[ Edited ]

Is there a way I can make that field required only if Closed Lost is chosen ?

 

Or is there a way to make that field only visible if Closed Lost is chosen ?

 

I'm using Professional Edition, just in case you needed to know that.

 

 

 

 

EDIT --- nvm I got it working with your first code example.

 

Thanks again sir.

Message Edited by Grifmang on 02-24-2010 01:30 PM
Super Contributor
Stevemo
Posts: 3,210

Re: Closed - Lost to required field Reason Lost

I'm not sure what you mean, do you mean using only StageName instead of IsClosed/IsWon?

 

I guess then you'd do something like

 

 

AND(ISPICKVAL(StageName, "Closed Lost"),ISNULL( Reason_Lost__c ))

 

 

"If you're in a band and you think that you're good, you probably suck. If you're in a band and you think that you suck, you probably do." - Bob Pollard
Regular Contributor
Grifmang
Posts: 16

Re: Closed - Lost to required field Reason Lost

To answer your last question, I basically was just wondering if there was a way for my "Reason Lost" field to be hidden unless "Closed - Lost" was selected from a picklist.

 

But needless to say I was able to get it working using the LEN example you gave.