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
abhinav Krabhinav Kr 

How to have a custom message for any required fields ?

Scenario I have tired:
I have created custom object (School) with a custom field (Address) and checked it as required.
 
Now the message is displayed as “Error: You must enter a value“ .
Instead of this message I want to display the message as “Address Is Compulsory”.
Please suggest how to do this.
Best Answer chosen by abhinav Kr
ProlayProlay
Either you can do it through Validation rule or you can create Visualforce pages and put your custom message through Apexpage. Please see the link belowhttp://salesforce.stackexchange.com/questions/60141/how-to-display-different-error-messages-at-different-places-on-a-visualforce-pag
 
There is no other way you can achieve this in SFDC

All Answers

ProlayProlay
Instead of making it required, create a validation rule to make the field mandatory. In validation rule, you can display custom message 
abhinav Krabhinav Kr
Hey Hi Prolay,

Thanks for replying.
I know that in validation rule we can have custom message but can't we do it on the required field too.
ProlayProlay
Either you can do it through Validation rule or you can create Visualforce pages and put your custom message through Apexpage. Please see the link belowhttp://salesforce.stackexchange.com/questions/60141/how-to-display-different-error-messages-at-different-places-on-a-visualforce-pag
 
There is no other way you can achieve this in SFDC
This was selected as the best answer
abhinav Krabhinav Kr
Hi Prolay,
Thanks a lot. I am going through the link you have given.
ProlayProlay
Make sure you select the best answer for the benefit of the rest of the community