You need to sign in to do that
Don't have an account?
ethanone
How can I turn off all code?
My triggers and classes are getting in the way of using the data loader to load my data. If I make the triggers "inactive", my test coverage drops to 0% and I can't deploy the triggers in the inactive state. Is there any way to turn off all code including classes (as if none existed)? And of course I'll need to put it all back afterwards.
All Answers
They are set up for bulk, the problem is more one of data quality (fewer enforced rules on old system) and the fact that you can't load related at the same time as parent tables (example: our closed opportunities require at least one related record in a custom child table).
As far as solutions go, I've experimented with copying the classes folder to my desktop, deleting them and then copying them back. It is much faster than touching each class by commenting them out, but it seems particularly heavy-handed. Does anyone think this is a bad idea?
Instead of deploying 'inactive triggers' from your sandbox to production, create a new Eclipse project directly from your production instance. Once you set the triggers to inactive, Save the changes (no need to deploy since you're already in production).
Remember to activate your triggers when you're done with Dataloader :smileyhappy:
I just tried Captain Obvious's solution without success. When I set the trigger metadata to "Inactive", I get save errors (file saved locally and not on server).
On another front, I heard back from a SFDC tech who said I could save the classes and triggers to my desktop, delete them from my sandbox, deploy the classless and triggerless sandbox to production, run the dataloader, then copy the classes and triggers back to sandbox and redeploy. It makes me nervous, but I'm going to try it.
Hi, Can you please explain how you deployed the Empty sandbox. Not sure if I followed on this part. How do you deploy no triggers (if that makes sense)??
I'm in the same situation and I was thinking of the idea of making my trigger inactive in sandbox and deploying the inactive trigger to production but not sure if that would work after hearing about code test coverage etc , and im definately not willing to "test" this out in a live instance of salesforce.
Help would be great!
B2A
What a pain!
Instead of going through that whole re-deployment process, could you use a Custom Setting?
Create a isActive checkbox in a custom setting. Reference that checkbox in your trigger so that the code executes only when the checkbox is checked. Something like this:
With that in place, you'll be able to import your data by simply unchecking the box in the custom setting. The trigger will still fire, but no code will execute....
Good Luck!
I did this a while ago, but If I recall correctly, i deleted the triggers from my sandbox and when i deployed to production, it deleted them from production. So in essense, an empty deploy is really a delete.
The custom setting option is probably safer, but I haven't used it since my "nuke the site from orbit" solution worked. And I'm not familiar with custom settings, but i should be.