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

field validation - how do you do it

im not really loving the way required fields are handled
 - sometimes it wont let me change rendered boxes, like an edit view vs a read view (get stuck in edit mode)
 - the error message isnt always clear : j_id0:j_id2:j_id10:EditInfo:j_id23:j_id29:j_id33: Validation Error: Value is required.
 - sometimes the indicator is missing

i feel like im going to have to hand validate each field on this massive form: native account and contact fields with other custom fields
how do you end up getting the most out of coding and not having to worry about every single field?
unfortunately, saying required="true" just isnt really as user friendly as we need it to be
Maros SitkoMaros Sitko
If you do not want use standard functionality for required fields, you must do it in controller, where you can write own error messages via 'ApexPages.addmessage(new ApexPages.Message(ApexPages.Severity.FATAL, 'Please fill required fields.')); '.
Do nto forget add  tag <apex:pageMessages id="messages" />  to the page and rerender it after user click on save. I recommend you add some graphic sign next to required fields like salesforce do it (red vertical line)


Maros Sitko
SF Developer