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

Error Message Required Before Submiting for Approval

Hi everybody,

Is there any way to put custom error message based on some field criteria before submitting for Approval .

Let's say i have field A if it is blank and when i submit for approval then i want custome error message to be dislayed !

Thanks in advance !
Laxman Vattam 26Laxman Vattam 26
You can add javascript on the button itself to check various conditions and throw merror messages before submitting it for approval. 
Laxman Vattam 26Laxman Vattam 26
Once all the conditions pass, you can submit the record for approval process by calling apex class
Hi Laxman,

Can you give me snips of the code how to add on submit approval button and it will not affect the existing functionality

Laxman Vattam 26Laxman Vattam 26
Refere for step by step process for calling a apex method from java script in a button

Refer to get the syntax for submitting a record to approval process using apex