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
GetlinGetlin 

Undeploy invalid code

Hi all,

 

I need to deploy a trigger to production environment. There are some invalid triggers and test classes in production environment. So if I run test for existing code this test will fail. But when I try to undeploy this invalid code Salesforce try to run tests for this invalid code. 

 

So, is it possible to undeploy invalid code without running tests to it ?

 

Thanks!

GetlinGetlin

It's seems that it's impossible. Because Salesforce always runs unit tests independently of what you try to do.

Thanks

 

krishnagkrishnag

yaa u right.but you can make those invalid triggers inactive so that it wont count under unit tests

GetlinGetlin

But how can I deactivate it ?

Thanks!

GetlinGetlin

I tried to do it using Eclipse IDE, but had no success.

Jeremy.NottinghJeremy.Nottingh

In a sandbox, edit the Triggers you don't like, but clear out or comment out all the code; make them empty. Likewise for the test methods. Deploy all the empty code at once, and it shouldn't fail any tests, because there are 0 lines of code. Now they're toothless, and you can get rid of them at any time.

 

Jeremy

GetlinGetlin

Jeremy,

 

Great, thank you!