You need to sign in to do that
Don't have an account?
MrSalesForce
Allow Apex code to ignore validation rules
Is it possible to allow an apex trigger to write to an object without getting stuck in validation rules?
We have an object where it should be possible to change it via code but not via the user interface (read only does not work since only some types of the object cannot be changed).
It would be nice if it was possible to see if a change has been made by the system or by a user using the GUI.
Any ideas on how to accomplish this?
BR
Mattias
I wrote a blog post on this very subject presenting one solution:
http://bobbuzzard.blogspot.co.uk/2011/11/bypass-validation-rules-from-apex.html
Make use of immeditate attribute.
Example:
<apex:inputputField value="{!var}" immediate="true"/>
Regards,
Magulan D
Salesforce.com certified Force.com Developer.
SFDC Blog
If this post is your solution, kindly mark this as the solution.
That also ignores anything the user may have input on the page.