Find your content:

Search form

You are here

Cannot delete, no references but still says referenced elsewhere in


Every now and then when trying to delete something I get the "referenced elsewhere in Remove the usage and try again" message. And it incorrectly lists a bunch of resources (pages, classes, etc.) which does NOT have any reference to it. So far the only way I am able to get it to work is to go to every resource it lists and just re-save them one by one.

This time again I am trying to delete a static resource and its again showing me a list of pages which does not have any reference to it. Has anyone across this? is there any other easier way to deal with this?

enter image description here

UPDATE: The salesforce developer support have confirmed that this is a recompile issue and currently the only way around this is to save all those pages back to the server to cause a recompile.

Attribution to: manubkk

Possible Suggestion/Solution #1

Search for what you are trying to delete using the IDE, this should bring up any pages/classes, triggers, etc, that are referencing that specific component.

Attribution to: PepeFloyd

Possible Suggestion/Solution #2

I have experienced this before, but had never looked into it in detail. The template aspect is interesting, as it dovetails with something I've noticed elsewhere in Visualforce. It looked like there was a 'compiled' version of the Visualforce page that had the various templates, components etc applied, presumably for caching purposes. If I changed a component that was embedded into a page, I sometimes had to resave the parent page by adding and removing a single space character. This then pulled the updated component information in.

The only other thing I can think of to try is accessing the rendered Visualforce page and carrying out a hard refresh - I recall having some success with this in the scenario I've described above, but I don't think I've ever tried it in your situation.

Attribution to: Bob Buzzard

Possible Suggestion/Solution #3

Answering my own question, the way around this is to save all those pages back to the server. But the code won't recompile if there is no change in the code.

The most obvious way to change the code is to add an extra space character somewhere in your source but this would unnecessarily modify the page and include it as a changed file when you deploy to Production or other Sandbox.

To avoid this, the easiest way is to use the IDE's search and replace, search for all "<apex:page" and replace it with "<apex:page " (please not the space in the end). Then select all the pages and save it to server. This would cause the page to recompile but salesforce would force it back to original (without the space) since it does not allow extra space characters between apex page attributes.

Attribution to: manubkk
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content