You need to sign in to do that
Don't have an account?
Gaby Frydman
VisualForce page becomes read only after validation rule conflict
Hi all,
I am meeting some interesting challenges which I can't seem to figure out:
I have a site which is running a visualforce page that collects customer details. Customers can log in with their Customer Number and Date of Birth before being taken to completing a form of fields.
Problem is that when a conflict with validation rules occures, the page becomes read-only and the customer needs to refresh the page and no changes would be saved.
Any workarounds?
I am meeting some interesting challenges which I can't seem to figure out:
I have a site which is running a visualforce page that collects customer details. Customers can log in with their Customer Number and Date of Birth before being taken to completing a form of fields.
Problem is that when a conflict with validation rules occures, the page becomes read-only and the customer needs to refresh the page and no changes would be saved.
Any workarounds?
The issue was in the controller:
I added the following to my try clause
catch (DMLException e) {
editContact.Id = null;
ApexPages.Message msg = new ApexPages.Message(Apexpages.Severity.ERROR, e.getdmlMessage(0) );
ApexPages.addMessage(msg);
}
as opposed to
catch (Exception e) {
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, e.getMessage()));
}
Hope that helps anyone else