You need to sign in to do that
Don't have an account?
miteshsura
deactivate validation rule in APEX
Hi,
Is there a way to deactive a validation rule in APEX. I want to update a record from APEX, but do not want to fire Validation rule, if the same rule is fired from UI, validation rule should fire.
I am thinking to deactive just before record.update and active again. Can this be done? Is there any other way to acheive this?
thanks for the time.
Mitesh
The way we've handled this in the past is to set a field on the record to indicate it was updated programmatically and adjust the validation rule to exclude those records that have that field set.
All Answers
The way we've handled this in the past is to set a field on the record to indicate it was updated programmatically and adjust the validation rule to exclude those records that have that field set.
why I did not think of that before?? probably I come from tradtional development background.. thanks for the idea..
Can you explain what you mean by newly added field?
http://bobbuzzard.blogspot.in/2011/11/bypass-validation-rules-from-apex.html