You need to sign in to do that
Don't have an account?

How to create a trigger programmatically?
I would like to be able to create a trigger programmatically. Is this possible and if so, using APEX code, APEX Web Service code, or AppExchange Web Service API? Example code would be helpful too. Thanks very much.
Hope this helps.
Hi Simon!
I have imported the apex wsdl to eclipse and using the setter and getter methods avaliable in the corresponding classes trying to create a trigger. The classes in the apex wsdl CompileTriggerResult and compileTriggers compiles the existing triggers and does not create a trigger from scratch. So, this would mean that we cannot programmatically create trigger even by using apex wsdl.Please correct, if I am wrong.
you call compileTriggers passing in the new trigger(s) you want to compile as the parameter.
Thanks Simon!
We were able to create triggers programmatically.
Hi Sunitha,
Can you please explain the steps to create triggers programatically ??
Our scenario is, User will Select the Object, then select the fields in it (custom + standard) and also the trigger condition (that is after,before create/update/delete). Our Apex code should create a trigger with all the above said details.
It would be great if you can help us by explaining the steps to create triggers programatically. Thanks.
Regards,
Sethuraman.AR
Can you provide me the solution approach pls?