I have a Visualforce page that when there is more than one field error it only displays the first error in the apex:pageMessages section.
The Salesforce documentaion says all the pageMessages should display all the error messages.
How can I get all the errors to display?
Validation logic.
if (c.Subject == null) {
valid = false;
c.Subject.addError('You must enter a value');
}
if (c.ContactId == null) {
valid = false;
c.ContactId.addError('You must enter a value');
}
if (c.Priority == null) {
valid = false;
c.Priority.addError('You must enter a value');
}
if (c.Description == null || c.Description == '') {
valid = false;
c.Description.addError('You must enter a value');
}
if (!valid) {
return null;
}