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
Will Johnston 34Will Johnston 34 

Best way to delete apex class in production?

I've used the following method in the past to delete apex classes from production. Is there a better or easier way to do it?

https://www.salesforceben.com/way-to-delete-apex-classes-from-production/

(The title of the article is "An Easier Way to Delete Apex Classes from Production," but it's a few years old now, and I'm looking for an *even* easier way. I guess I'm greedy?)

I have found numerous old references to using the Force.com IDE but the IDE has been officially retired. I'm also looking for an option that doesn't involve the ANT Migration tool.
Sitarama MurthySitarama Murthy
Hi Will,

Try using VS Code editor with Saleforce Extension package installed in VS Code.
once setup is done sync your production code and modify the XML of the class which you want to delete the sync back the main XML pakage to SFDC org.

Thanks
Ram
Will Johnston 34Will Johnston 34
Ram,

Thanks for the reply. Can you provide more details on the process you described?

I recently found the post below that details how to use the SFDX CLI with destructive changes and it seems like a good approach. Is what you are describing similar to this?

https://www.linkedin.com/pulse/how-delete-classes-triggers-from-salesforce-production-amnon-kruvi/

Thanks,
Will