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

Delete Apex class from Production

Can we delete apex class from Production environment?


i know we can disable but looking to delete them


delete the class(es) from the source org, then deploy the Classes folder to Prod to deploy those deletes.


That's correct. Just remember though that you'll be required to have >=75% test coverage across the remaining code base in your Production Org after these classes are deleted.


And it will get your heart rate up as you'll convince yourself part way through that its actually going to delete all your live code :)


Ok I see now. Thanks.  Earlier someone was trying to find out if you could just go into the Meta XML file of the class and just sleect Inactive just like you can do with Triggers in order to make the class inactive or deleted but I guess that would be dangerous if we could simply do that because of the possible impacts to other class files that are dependent upon that  newly deactivated  class(?).