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
SunnyButCloudySunnyButCloudy 

Validation to check various fields before advancing stages

Hello!  Here's my issue:

 

I'm trying to make sure certain fields ($$, date, and picklists) are filled out before someone can switch the stage (ie closed won must have payment due date, amount, and length of term (drop down)).  

 

I looked around the forums and found these individually. ie. 1 validation rule for stage = closed won, isblank(fieldname)...etc.

 

How would I combine these various types of fields and map them to one stage validation?  I'm a newbie and stumped.  Thanks in advance.

CalvinHobbesCalvinHobbes

hey, if x,y,z are the fields you want to check you may try the following:

 

AND(

NOT(ISNULL(x)),

NOT(ISNULL(y)),

NOT(ISPICKVAL(picklist field,'')

)

 

for the picklist field check you would need to use NOT(ISPICKVAL(field,'')). here '' -> checks null i.e. no value is selected.

 

The validation rule will be evaludated when all above is true and would allow to save the record if evalution turns out to be false.

 

If you want more info, please provide exact names of the field, api names and I would give you the validation rule.

 

Regards,

CH

SunnyButCloudySunnyButCloudy

Thanks! What I did instead was create a validation rule that looked at status and then field, status and then field:

 

 

OR( 
AND(ISPICKVAL(StageName, "Stage1"),ISBLANK (Field1 )), 

AND(ISPICKVAL(StageName, "Stage1"),ISBLANK (Field2)), 

AND(ISPICKVAL(StageName, "Stage1"),ISBLANK (Field3)))

 

Does the trick...Thanks for your help though!  I'm loving Salesforce!