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
CRMNirvanaCRMNirvana 

Opportunity Validation Rule -checkbox Field, Sales Process Stages and Record Type

How would a Opportunity based Validation Rule be created if a checkbox field (i.e. Credit Approved) most be selected before saving a Opportunity record and the Sales Process Stage is either "Process Order," "Closed Won" or "Installed" for a particular Opportunity Record Type?

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Okay, here you go.  And when you speak of me, speak well.

 

 

AND(
(IsWon ),
OR(
ISPICKVAL(Program_Scope__c , ""),
ISPICKVAL(Integrated_Payments__c , ""),
ISPICKVAL(Program_Type__c , ""),
Number_of_Locations__c < 0,
LEN( Implementation_Contact__c) < 1))

 

 

All Answers

Steve :-/Steve :-/

Do the Opportunity Stages 

"Process Order," "Closed Won" or "Installed" 

equal Closed/Won in your Sales Process?

Are there any other Closed/Won stages that you want to exempt from the VR?

CRMNirvanaCRMNirvana

No

Steve :-/Steve :-/

Here you go

 

AND (
NOT( Checkbox_Field__c ),
$RecordType.Name = "OpptyRecordType",
OR (
ISPICKVAL( StageName , "Process Order"),
ISPICKVAL( StageName , "Closed Won"),
ISPICKVAL( StageName , "Installed")))

 

 

PS.  You owe me a beer! 

http://beeradvocate.com/beer/profile/863/7971/

jarrodmichaeljarrodmichael

Steve,

I am having a similar issue.  I am needing to require 3 picklist fields, a Contact Lookup and a Number field when the stage equals Closed Won.

 

Here is what I have but it's not firing for some reason:

 

AND(
   ISPICKVAL(StageName, "7 - Closed"),
OR(
  ISBLANK( Implementation_Contact__c ),
  ISNULL(Number_of_Locations__c ),
  ISPICKVAL( Program_Scope__c , " "),
  ISPICKVAL( Program_Type__c , " "),
  ISPICKVAL(  Integrated_Payments__c  , " ")))

 

AND(   ISPICKVAL(StageName, "7 - Closed"),

OR(  ISBLANK( Implementation_Contact__c ),  

ISNULL(Number_of_Locations__c ),  

ISPICKVAL( Program_Scope__c , " "),  

ISPICKVAL( Program_Type__c , " "), 

 ISPICKVAL(  Integrated_Payments__c  , " ")))

 

Thank you for any guidance you can provide!

Steve :-/Steve :-/

Okay I'll take a crack at it, but you owe me a beer

http://beeradvocate.com/beer/profile/863/7971/ 

Steve :-/Steve :-/

Okay, here you go.  And when you speak of me, speak well.

 

 

AND(
(IsWon ),
OR(
ISPICKVAL(Program_Scope__c , ""),
ISPICKVAL(Integrated_Payments__c , ""),
ISPICKVAL(Program_Type__c , ""),
Number_of_Locations__c < 0,
LEN( Implementation_Contact__c) < 1))

 

 

This was selected as the best answer
jarrodmichaeljarrodmichael

You are the man Steve!  Rest assured that when I speak of you I will speak well!  Thanks for the help!