2

I have a change set that is getting hung up on an old class that is no longer getting used so I want to delete it from our production environment.

I have seen a bunch of posts on how to handle this but have had no luck:

  1. First try, changing the status in the .cls-meta.xml Deleted status

But there is "no differences detected" when I try to deploy to the server: enter image description here

The warnings are just telling me that the file is saved locally, not to the server.

  1. I tried the desctructivechanges.xml method mentioned in other guides with no luck either. package.xml get deployed with destructivechanges.xml having no components listed but I do not see the xml in the changeset.

While I was typing this out I came across an article mentioning the "compileAndTest() or deploy() Metadata API methods" using force.com IDE and assume this is the piece of this I am missing.

The account I am using has all the necessary permissions needed to author apex.

Anyone have any suggestions for me to get this working?

2
  • first try "Save to Server" option on eclipse and after that try to deploy the file. Aug 3, 2015 at 12:44
  • The <status>Deleted</status> changes back to <status>Active</status> when I save to server.
    – Allen Mann
    Aug 3, 2015 at 13:13

2 Answers 2

1

Just delete it.

First off your project should be set to 'Work Online'. enter image description here

Right click on the class, press delete. If your project is set to 'Work Online' in the Force.com menu, the prompt will ask if you wish to delete the resource from the server as well, click yes.

screenshot

1
  • I found that an old VF page was using the controller (causing the destructivechanges.xml to fail I would imagine), so thank you very much for the suggestion. However, I deleted the old page from the server but I still see it listed in my pages in the UI.
    – Allen Mann
    Aug 3, 2015 at 18:29
0

It sounds like you are trying to do this with an Eclipse Project that is based on your Production org. You are not allowed to make changes directly to Apex classes directly in Production, instead you must deploy the change. Are you allowed to delete the class from a Sandbox org? If you do this, either in an Eclipse project for the sandbox org or in the UI, when you refresh the project and attempt a deploy to production, Eclipse should offer to delete the class from Production.

1
  • Thanks for the feedback. I did try this. I went into our sandbox UI and deleted the class. But I do not see a prompt to delete the class from production when I deploy.
    – Allen Mann
    Aug 3, 2015 at 14:50

You must log in to answer this question.

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