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
Sudheer KommawarSudheer Kommawar 

How to handle multiple error messages in a single validation rule defined on one particular field?

Based on the field validation I need to display an error message accordingly by using single validation rule is defined on particular field.
Let's say.. 1. when Amount field​ is entered as '0' then I should display an error message 'Amount should not be Zerio'.
2. When Amount field is entered with Negative values then I should display an error message 'Amount should not be less than Zero'".
I need to handle this scenario by writing single validation rule on this field with multiple error ​​messages and should display at a time one error message If that particular condition is satisfied. Please suggest me with your probable answers.
Best Answer chosen by Sudheer Kommawar
ManojjenaManojjena
Hi Sudheer ,
You can write your validation like ,assume in account NumberOfEmployees field you have written ,
 
NumberOfEmployees  <= 0
Error message

Employee number should grater then zero.

I think above will help you . you can not write two error message in one validation else you have to write two validation.
Let meknow if it helps .
Thanks
Manoj
 

All Answers

ManojjenaManojjena
Hi Sudheer ,
You can write your validation like ,assume in account NumberOfEmployees field you have written ,
 
NumberOfEmployees  <= 0
Error message

Employee number should grater then zero.

I think above will help you . you can not write two error message in one validation else you have to write two validation.
Let meknow if it helps .
Thanks
Manoj
 
This was selected as the best answer
Sudheer KommawarSudheer Kommawar
Thanks Manoj for Your suggestion!! Doing the same thing creating multiple validations for the one field itself :)
Rishabh Pal 1Rishabh Pal 1
How do we handle if there are more than binary situation like 100s of conditions. We can't keep on creating 100 validations. Is there a better way?