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
Jeremy StoryJeremy Story 

Delete Apex Class

I have tried and tried to delete an Apex class created when I tested out the 'sites' functionality.  It is blocking the install of NPSP 3.0 because the class assumes we are using portals.  

How can you delete an Apex class?

I have tried the following:
1.  Using Eclipse with Force.com IDE - marking the xml file from 'Active' to 'Delete'  = result is file says it deployed successfully - it shows in Eclipse in the XML as still status Deleted---but in SF the file is still active.  It only lets me delete Apex tests this way...not the actual Apex file being tested.
2.  Deleting in a sandbox - then there is nothing to put into an oubound deployment to production server
3.  Marking as deleted as in #1 but in the Sandbox and then deploying to production server from the Sandbox...it still doesn't work

What else keeps an Apex file from deleting or even being able to update its code?  If it is dependencies and I cant remove the dependent references from the code how do I remove the dependencies.

I tried also deleting the Visual Force Pages that are related to the Apex class.  It won't let me delete them either.  Activating 'sites' really has messed up my ability to deploy/install NPSP 3.0 to my SF instance.  It sets up bunches of Visual Force Pages and Apex code files in the system.  It also lowers the amount of tested code for deployment.  I can't figure out how to get rid of all these Apex Code files and Visual Force pages because the system won't let me delete it no matter what I try.
Michael VerhovskiMichael Verhovski
How about deleting the class from sandbox and then deploy the whole of the classes directory
Jeremy StoryJeremy Story
Deploy the whole class directory through inbound change sets from the sandbox?  or through some other way?
MFrederickMFrederick
I have found ANT Tool the best for deleting. There has been times that I have deleted using the IDE. Sometimes setting the xml seems to work. Othertimes I prepare a project package in IDE with the class and then I delete it in the sandbox though the gui. And then deploy the package to production. When SF recognizes I am going to delete it shows in the  deploy window as delete.