I'm looking to add functionality to my managed package that would dynamically create a trigger based on user inputs. I've seen some conflicting answers about whether a trigger can be created using the REST or Tooling API, does anyone have any experience creating a trigger on the fly?

The functionality I'm looking for would allow them to set up a trigger within our app without the need for first writing the trigger in a sandbox, writing the test case, deploying, etc.


Take a look at the Declarative roll up summary tool for an example of dynamically creating triggers

Declarative roll up summary


The tooling API works great in Sandboxes and Dev orgs, but not in Enterprise orgs. I described how to do it with the SOAP API under another question Dynamic Trigger Creation From Managed Package

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.