10

Because the documentation defines it that way. Yes since Winter'15 it explicitly states:

Although a component is deleted, its Name remains within Salesforce. You can never create another component with the same name. The Deleted Package Components page lists which names can no longer be used.

and

If the Managed - ReleasedManaged - Released package hasn't been uploaded with the component deleted, this contains an Undelete link that allows you to retrieve the component.

I don't understand why this is needed and it's really bugging me as extensive class renaming (a good refactoring practice) leads to all the good words being unusable after a while. Just an example:

I am naming my Domain classes (per object trigger handlers) as the plural of the SObject. In one of the last releases of our ISV software we got rid of the need to handle trigger events and so I thought I could also get rid of the now empty trigger class. Doing that I lost one of the most self-speaking and most suitable class names for the whole software :-(

  1. The whole reason for this question is to hear from someone a good explanation why it is not possible to just reuse this name? It's not a global class that could be referenced by some one else who must be sure that I do not change the semantics behind an interface.
  2. What is this not allowed when I can change the code (therefore semantics) from each minor Patch release?
  3. Is this worth a new entry in the IdeaExchange?

1 Answer 1

3

The fact that we could undelete classes that we deletes in already uploaded version was not a feature but a bug. After some days of intensive communication Salesforce.com support could reproduce it and fix the severe problems we ran into due to this platform bug.

3
  • Did you ever hear back on this, were you able to reuse the class again? Mar 3, 2017 at 15:11
  • 1
    @ShaikhMohdNadeem: Support told me this is intended behavior and I indeed was never able to reuse such classes. Mar 3, 2017 at 15:13
  • 1
    :( This makes me think if the correct way to deprecate the class would be to add the deprecated annotation and throw "This class is deprecated" exception in its methods, in case the class may turn out to be useful in future? Mar 3, 2017 at 15:17

You must log in to answer this question.

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