I am trying to create a lightning component that allows user to select an object and activate a trigger according to the object selected, similar to process builder but I’m trying to integrate this functionality to an app so I was wondering if this is possible.

2 Answers 2


Apex trigger is the code which is directly attached to database and can be invoked ONLY by Apex DML Operations. You may use Apex class as handler/helper classes which when invoked from trigger will have trigger context variables but when you try to invoke same handler/helper classes from outside like lightning component/process builder, you will not have any scope of trigger context variables.,

  • He probably meant creating dynamic triggers.. Aug 31, 2019 at 17:34

Triggers are basically metadata, that means in order to active a trigger you have to do a deployment.

Various app exchange packages do this, one notable example being DRLS, they use Apex metadata API wrapper to dynamically deploy code on its own org.

  • This was very helpful, thanks.
    – sfBilb
    Aug 31, 2019 at 22:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .