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
GunnarGunnar 

Rolling Back Apex - Deployed via Change Set

I have deployed a small app - with Apex, Tests - via a Change Set.

Usually use packages.

 

Well, as usual, there are changes to the functionality.

 

I need to remove the Apex code from production. But can't.

 

Removing the 'Change Set' won't remove the code.

 

So the question is, how do I remove apex classes and triggers that deployed via a Change Set??

 

Uber Thx In Advance.

Best Answer chosen by Admin (Salesforce Developers) 
Vinit_KumarVinit_Kumar

Gunnar,

 

Please follow the below steps :-

 

1.) In force.com IDE,Click new and create a Force.com project.

2.)Put your user name ,password with security token and click next.

3.) Click on all Organization data and clikc next.

 

And,your package is created and then you can go ahead and remove the undesired code.

All Answers

Vinit_KumarVinit_Kumar

Unfortunately,you can't remove the code from Producgtion using change sets.What you need to do is below

 

1.) create a package of your production in force.com IDE 

2.) right click on the class which you want to remove and then delete it

3.) Right click on the package and then go to force.com link and then synchronize to server.

 

Then,you will ahve your production org synchronized with your force.com IDE components which is without the unwanted Apex Code.

sf_evolutionsf_evolution

Hi Gunnar,

 

Another option (I don't know how much code you're talking about here) is to create a trigger (or whatever class is the problem) in your sandbox that basically does nothing, and deploy that.

 

 

GunnarGunnar

Thanks for this. Will try - likely tomorrow or Thursday.

Will advise...

 

Teach_me_howTeach_me_how
we do inactive the trigger on sandox(the one has been deployed in prod) then after inactivating the trigger on sandbox we redeploy it once again in prod
GunnarGunnar

You said : create a package of your production in force.com IDE

 

I'm not finding where I can do this in the IDE.

 

How do I create a package of production in the IDE??

 

I am back to this project, and need to get this code outta here :-)

 

This is the first time and the last time I am deploying apex in a change set.

 

I've always used packages.  This PITA is costing me hours and hours.

Vinit_KumarVinit_Kumar

Gunnar,

 

Please follow the below steps :-

 

1.) In force.com IDE,Click new and create a Force.com project.

2.)Put your user name ,password with security token and click next.

3.) Click on all Organization data and clikc next.

 

And,your package is created and then you can go ahead and remove the undesired code.

This was selected as the best answer
GunnarGunnar

Aaah!

 

I had done that, but didn't realize I could simply click on Delete!

 

Deleted the class from the list - went to Production and POOF - it's gone.

 

Perfect!

 

Thanks!