I'm having a peculiar problem with a class in production. The class is this one: https://github.com/907pine/NWHRN-sandbox/blob/master/src/classes/TrialCustomerPortalHomePageController.cls and I have no idea how it got there, and no one else does either. Usually when in my day-to-day org I'm able to delete classes by editing the class metadata, saving, and deploying the class to production. This class, however, just reverts back my changes when saving, making me think that this is either a built-in class (which it can't really be) or some class that came with some managed package (which it shouldn't be either since then the code wouldn't be visible). So it must have been copied from somewhere and deployed without regard for test coverage.

I see also, after browsing that github repo, that all of the classes there are present on the org. Are they a part of some SF Edition, like Developer Edition? Can anyone give an admin some pointers how to to get rid of these classes since after asking around - no one seems to know why they are there or for what purpose.

  • Are you attempting the delete class in production or a sandbox? Jan 8, 2014 at 23:31
  • When was the class created, and who by? This will help you determine its origins.
    – sfdcfox
    Jan 8, 2014 at 23:36
  • I've reached out to the person who setup those classes.
    – akarnid
    Jan 9, 2014 at 9:10

2 Answers 2


The inability to delete a class in production usually indicates a dependency. My best advice is to burn a fresh sandbox and see if you can delete the class in there and then deploy your classes directory with the deletion.

  • I already tried to refresh to a new Sandbox and try it there. No luck. On the sandbox env, the class has a dependency on another class that isn't even on the production org. If I try to add that class to prod, it fails because of insufficient test coverage. I'm going to try another fresh sandbox, other than that, I'm going to have to try and see whether the person who created the class knows anything about this.
    – akarnid
    Jan 9, 2014 at 0:20

I'd like to add to this old question, if anyone else stumbles onto it from Google, that the best and easiest method to remove classes from production is to use the Ant Force.com Migration Tool, specifically the 'undeploy' option. Takes a bit to set up, config wise, but in the long run the best tool too to this with.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .