You need to sign in to do that
Don't have an account?
Sandy singh
Display warning message on filed level
Hi all,
I want display warning message on filed level [Requirement: if date field is less then current date show warning message on that filed and allow user to enter the data].
Please help me on this issue.
Regards,
Sandy
Hi Sandy,
If you want to display error message below the field, you can create validation rule for that and select the field in 'Error Location' in the bottom of the validation rule page.
Hi ranjeet,
Thanks for solution but my requirement is to display warning message not error message. so that if condition is true it show warning message and then allow to proccess.
Thanks,
Sandy
For error handling you can add apex:messages should be added to the Visualforce page and then use something like this in the controller:
if (ErrorCondition == true){
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,’Add your message here’);
ApexPages.addMessage(myMsg);
return null;
}
Link to Salesforce documentation --
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_pages_message.htm
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.Warning,’Add your message here’);
Replace the .Severity.Error with .Severity.Warning.