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
aparkmanaparkman 

Not allow user to "submit for approval"

I am currently working on a validation rule, and can't figure out how to write it to make it work. In my current project I have made two objects, Pricing Request and Price Adjustments. The user will fill out the form for the Pricing Request, save and then goes into the Price Adjustment object on the Pricing Request Summary Screen. The user will then fill out some Price Adjustments, go back to the PR summary, and click "submit for approval". The rule I'm making is to not allow the user to submit for approval if there are no Price Adjustments. I made a field in Pricing Request that counts the number of Adjustments, and i want it to say if "# of Price Adjustments = 0", and when the status is changed to "In Progress",to not allow submitting. But it will still let me submit. The formula Validation rule i wrote is:

 

AND(
Number_of_Price_Adjustments__c = 0,
ISPICKVAL(Status__c, "In Progress")

 

I also tried ISCHANGED(Status__c)

Any ideas on what I'm doing wrong/what I need to be doing?

 

Thank you,

Adam

 

liron169liron169
The button Submit for Approval, it's SF standard and run regardless of validation rules.

You can either:
1.Override the standard button by custom button. In inside the custom button you will be able to write any validation you need.

2.More simply, add this condition inside the approval process entry criteria.