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
Matt FolgerMatt Folger 

Invisible Duplicate Class Error: "Class name is already in use or has been previously used "

Well I created a Public Class/Controller, then I couldn't find it (wasn't coming up in any search), so I tried and recreating it, but it says it's already created.  What gives?  This is very bizarre behavior.  
Best Answer chosen by Matt Folger
MJ Kahn / OpFocusMJ Kahn / OpFocus
Hey, don't get cocky!  :) 

Much as I hate to doubt you, there's probably a reasonable explanation for what's happening. Please post whatever you find, ok?

All Answers

MJ Kahn / OpFocusMJ Kahn / OpFocus
How are you looking for the class? Are you in the regular browser, on the Apex Classes page, in the Developer Console, or in an IDE like Eclipse or Sublime?

Check the Apex Classes page - that's pretty much the ultimate authority on whether the class exists or not.

Matt FolgerMatt Folger
I'm just looking in the Apex Classes Page.
MJ Kahn / OpFocusMJ Kahn / OpFocus
Interesting. Is your class part of a managed package that you're working on? If so, this (https://developer.salesforce.com/forums?id=906F0000000903DIAQ) might help.

Is the list view you're using on the Apex Classes page filtering in a way that might be hiding the class in question?

And (just to be sure), you're a full System Administrator, right?
Matt FolgerMatt Folger
It shouldn't be part of any managed package, I just created it.  I followed that link and it seems to be inapplicable to this, and I can't see any deleted packages in that screen.  I'm a full system admin, I've never had a permission issue with anything else.

 User-added image


MJ Kahn / OpFocusMJ Kahn / OpFocus
When you delete a class, it's gone - there's no recycle bin for classes. I just created a class, deleted it, then created another class with the same name - no problem.

I'm sorry - I wish I had an answer for you! I'd suggest logging a Case with Support - if the situation is as you say (it's telling you that the class you're trying to create already exists and it very clearly and definitely doesn't exist), then it sounds like a (very odd) bug to me.
Matt FolgerMatt Folger
Wow, cool.  Do I win a trophy for breaking the platform?  Maybe I can get a part of that $1,000,000 hackathon that's going on.

=P

Thanks for you help!

Matt FolgerMatt Folger
Hmm, so then there's this:  "Developer support for standard customers and partners is supported directly through our community. If you have a developer support question, please visit our Developer Forum."

So, I'm stranded with an apparent bug in the platform?


MJ Kahn / OpFocusMJ Kahn / OpFocus
Hey, don't get cocky!  :) 

Much as I hate to doubt you, there's probably a reasonable explanation for what's happening. Please post whatever you find, ok?
This was selected as the best answer
Matt FolgerMatt Folger
Well I found that I can't submit a support case, so I'm stuck.  How can we get one of the moderators to look at this?
Matt FolgerMatt Folger
Eureka!!!!!!  I found it!  Somehow it didn't appear in the main screen, but when I click on "V" at the top then now I see it!

I repent!  Salesforce can do no wrong!  Forgive me lord!

8^P
MJ Kahn / OpFocusMJ Kahn / OpFocus
"V"?!? What V?
Matt FolgerMatt Folger
"V" for Victory my friend!  VICTORY!

I'm an idiot, that's the problem, I thought everything would be on one page, but I didn't notice the tiny "Next" button on the upper right.

*Begins self-flagellation process*
MJ Kahn / OpFocusMJ Kahn / OpFocus
Gotcha.

Fun times....

Clearly, it's time to go home.
Resample AdminResample Admin
If this is occurring when creating a class from developer console .... closing and reopening the console resolved the issue.