Is it possible to activate or deactivate workflow,trigger,validation rule and flow through apex class ? If yes then how to achieve this..

  • No, not from Apex. As you stated, only through Metadata API, then deploy this changes. Jun 1, 2016 at 13:36
  • deactivate for the life of the transaction or permanently?
    – cropredy
    Jun 1, 2016 at 14:31

1 Answer 1


I think one of the better ways is to use custom setting or any checkbox to bypass validation and workflow rules etc. You can check or uncheck the checbox from apex code.

ex: AND(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.