+ Start a Discussion

Validation on Submit for Approval button

Is there any way to write a validation when a user clicks on Submit for Approval button for an approval process? 


Submit for Approval button is not even visible in the Button and Links section. So, I am not sure how to do it.




The Submit for approval button is normally only on the Approval History related list. Through the page layout editor you can add the same button to the detail section buttons as well.


Validation on submission will be done automatically, by evaluating your approval process' entry criteria. If no entry criteria match, the user will receive an error when submitting.


The reason I asked if I can write a validation rule on Submit for Approval button is because we want to customize the following generic error message generated by Salesforce when the entry criteria is not met.


This record does not meet the entry criteria or initial submitters of any active approval processes. Please contact your administrator for assistance. 


We want to tell users, exactly which criteria was not met. I have been told by Basic Tech Support at Salesforce that I can create my own VF to display custom error message but I don't understand where that VF will be invoked from. Anyone has any ideas?



Did you ever solve this, as I am now hitting the same issue? 


Hello Tirnity,


I know its been a while, but can you post your javascript code here. I just want an idea of how your approach was towards the issue.