function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kevinbnpowerkevinbnpower 

Triggers Stuck as Invalid

Have an Enterprise edition account that I'm in the process of developing, and deployed classes and triggers valid and active from a sandbox over into production. When they arrived in production, the classes were valid, and a handful of triggers were valid, however, I have three triggers that are 'Active', but not valid. The dependencies are all there and in place, however, I cannot validate, delete, or otherwise modify the triggers.  When I redeploy the valid triggers from the sandbox back to production in an attempt to overwrite, they too become invalid.

 

Any suggestions on things I may be missing that would cause them to become invalid without becoming inactive, or is there anyway to revalidate, or otherwise confirm what is causing them to become invalid?  Better yet, anybody know of a way to force validation? I'd love to at least be able to RUN them so I could see errors/dependencies are causing the invalidation!!!

 

Thanks,

K

kevinbnpowerkevinbnpower

Okay, I don't know if this is a bug in SF or WAD, but I found this ridiculous.

 

I finally got them to validate. How? By triggering them. But apparantly, in SF, the test code for triggers isn't what validates them, you actually have to manually trigger the code. Meaning that, if my trigger is on Opps and is a before insert, I have to insert a fake opportunity manually, then go back and delete it, in order to validate the trigger.

 

Why on earth wouldn't my test methods be good enough to validate the trigger, wouldn't even test data cause a trigger recompile?  Why do I have to insert fake data and then remove it to get the recompile and validation? I would love to hear an explanation for this.