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
Petercass88Petercass88 

validation rule for picklist

Two fields I am looking to modify are:

Stage (Standard Field:Picklist)

Req. Spec Sheet ( Custom field: check box)

 

Before an opportunity can be moved from the needs analysis stage to the proposal and price quote stage i would like a validation rule that requires the "Req. Spec Sheet" field to be checked.  If the field is not checked i would like it to reflect an error. 

 

I formulated a proper formula and everything and then clicked check syntax and came back with the error that only certain functions are allowed on picklists... ahh!!!

 

Can someone help me formulate this validation rule to work properly with a pick list?

 

Thanks!

-Peter

Best Answer chosen by Admin (Salesforce Developers) 
Prafull G.Prafull G.

As you are checking the Stage value as Proposal/Price Quote. You need to put this as string.

Try this one

 

IF(ISPICKVAL(StageName, 'Proposal/Price Quote'),(Requirements_Spec_Sheet_Reviewed_by_Eng__c =TRUE),  (Requirements_Spec_Sheet_Reviewed_by_Eng__c=FALSE)

)

 

with best,

crmtech21

All Answers

Prafull G.Prafull G.

Can you post the validation rule you written so far.

However, You shoud use ISPICKVAL method to validate picklist values.

like ISPICKVAL(Stage, 'Some Value').

 

with best,

crmtech21

 

 

Petercass88Petercass88

IF(StageName, ( Requirements_Spec_Sheet_Reviewed_by_Eng__c =TRUE),  (Requirements_Spec_Sheet_Reviewed_by_Eng__c=FALSE)) 

 

that is what i started to work on before i decided to check the syntax. 

 

essentially the logic would be...

 

IF StageName = price/complete quote   AND  Requirements_Spec_Sheet_Reviewed_by_Eng__c =TRUE  THEN "No Error"

 

IF StageName = price/complete quote   AND  Requirements_Spec_Sheet_Reviewed_by_Eng__c =FALSE  THEN "Please review Spec Sheet with opportunity engineer before proceeding to the quote stage"

 

I tried to play with the ISPICKVAL method but it was not making much sense to meas far as the logic statemens work for that formula.  Where do i include Requirements_Spec_Sheet_Reviewed_by_Eng__c in that function?

Petercass88Petercass88

IF(ISPICKVAL(StageName, Proposal/Price Quote),(Requirements_Spec_Sheet_Reviewed_by_Eng__c =TRUE),  (Requirements_Spec_Sheet_Reviewed_by_Eng__c=FALSE))

 

This is my new statement but the error i am receiving is:

 

Error: Syntax error. Found 'Price'

 

What is the API name for the stage "Proposal/Price Quote" or how do i find this?

 

sorry if some of this stuff is very basic and dumb, i only took 1 semester of programming in college so that isnt getting me very far with this ha!

Prafull G.Prafull G.

As you are checking the Stage value as Proposal/Price Quote. You need to put this as string.

Try this one

 

IF(ISPICKVAL(StageName, 'Proposal/Price Quote'),(Requirements_Spec_Sheet_Reviewed_by_Eng__c =TRUE),  (Requirements_Spec_Sheet_Reviewed_by_Eng__c=FALSE)

)

 

with best,

crmtech21

This was selected as the best answer
Petercass88Petercass88

works perfectly, thank you!