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

How to delete/inactivate classes in Production Instance
Hi,
We have some apex classes that have been deployed 3 years back without test classes.
Our production organization Now has exactly 75% code coverage( when i ran ALL APEX TEST Classes).
I have created a new trigger which needs to be deployed to the production. When trying to deploy the trigger and Its test class via Force.com IDE, it raises a error saying overall code coverage is 73%.
Now i want to deactivate/delete those apex classes that do not have test classes written.I do not know that why they have written and they are no longer used.
How can i accomplish this task of deactivating/deleting..
I tried searching the posts, but could not get a definitive way to accomplish this.
Any help or idea on this is highly appreciated.
Thanks,
Sales4ce
There's no way to "deactive" a class. It's either live, or non-existent. By delete, I mean, literally delete the class, and then deploy the container/folder above it (those, tell the target org that it doesn't exist, and give the option to remove it as part of the deployment).
Active/Inactive, to my knowledge, is not something you can manually set, but rather, something the platform does for some reasons, such as a class becoming invalid due to dependencies on another class failing, etc.
All Answers
you have to delete them from the "source"/dev org they were created in, and then deploy that change to the target/prod org. You use Eclipse > right click Classes folder > force.com > deploy to server. Then, find the ones you want to delete, in red.
Thanks for your reply!
I believe and understand that Deleting them from Dev org is changing the associated XML file of the class to "Inactive/Deleted".
I am confused at this step:
After changing the XML file of the associated class, I then save this back to the server.
But this did not change the class to "Inactive" back in my dev org. Can you let me know why this isn't saving back the class to inactive?
I would certainly appreciate if you can provide an example with steps.
Thanks for your help on this.
Sales4ce
There's no way to "deactive" a class. It's either live, or non-existent. By delete, I mean, literally delete the class, and then deploy the container/folder above it (those, tell the target org that it doesn't exist, and give the option to remove it as part of the deployment).
Active/Inactive, to my knowledge, is not something you can manually set, but rather, something the platform does for some reasons, such as a class becoming invalid due to dependencies on another class failing, etc.
If you have full sandbox environment ,
refresh it
do your changes and deploy to production .... I know this is not that straight forward ....but this is the only way
Thanks,
Bala
Thanks Paul! That certainly helped me understand better.
You can Inactivate triggers from development to Production using the XML edit but I have yet to do this with classes in Force IDE. It would be quick and cleaner if you could.