You need to sign in to do that
Don't have an account?
Displaying custom Validation error message in Visualforce pages
I have some additional fields on my VisualForce page that are not part of the Case Object. I don't know how to add those validation errors to the system generated validation errors (AccountID, ContactID, etc) that I display on the page.
I use the following:
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error,'Asset: You must enter a value'));
HOWEVER this only appears AFTER I have resolved all the system validations errors. I don't want them to have to click 2x if they have errors.
I also tried ===immediate="true"=== on the button that I have.
HOWEVER then I don't see any of the object data(AccountID, ContactID, etc).
Any idea what to do?
Perhaps adding addError() method in a trigger. As follows:
I am not using a trigger. It is just a Class with a Page. I think I may remove the <apex:message> from the page and put in my own section.