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
David Kerr 5David Kerr 5 

removing apex class from production

Hi,

I'm trying to deploy an apex class/trigger from sandbox to production.  Once in production, I'm trying to validate the deployment and I received 6 errors, putting my percentage coverage below the 75% threshold.  I'm looking for an easy way to remove these old apex classes from production so that the validation can remain over the 75% minimum.
Raj VakatiRaj Vakati
Below are the steps:
 
1) From Force.com IDE, select the class that you want to delete (Look for .xml extension )
2) Open that .xml version of your class and change the Status tag to Deleted.
3) Right click and save the file.
4) Now select "SRC" folder and right click--->Select  Force.com---> select Deploy to server
5) Log into your production org and follow the steps.
 
Note: if you have any test class for the class that you are deleting make sure you do the same like above and then select those 2 classes for final deployment.
Abdul KhatriAbdul Khatri
Please read the article will help you removing classes from production

https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/daas_destructive_changes.htm