+ Start a Discussion
john.krjohn.kr 

Hi All ! How to Give validation rule From object to on custom visulaforce page

Take an example Student__c is an object and in that object having fied called Age__c.Then i have created validation rule on student object the age less than 18 the validation rule fire.It's working on standard page.now i have created custom visulaforce page with student object fields then i enter the data into the fields the validation is not fired.validation is an active mode but on custom visual force page the validation not working any idea thanks..................

bob_buzzardbob_buzzard

The validation rule should still fire regardless of how you save the data.  Do you have an apex:pagemessages component available to display the validation error?

 

I wrote a couple of blog posts on error messages and visualforce which might help:

 

http://bobbuzzard.blogspot.co.uk/2011/04/field-level-error-messages-with.html

http://bobbuzzard.blogspot.co.uk/2011/04/field-level-error-messages-with_29.html

john.krjohn.kr

Yes on visualforce page i used apex:pagemessages tag ! but the validation message not showing on page