Most of the components that ISVs can remove/delete from their managed packages still exist in customer orgs that have the package installed.

I want to provide my customers with a list (Visualforce page) of such elements so that they know what can be deleted.

I know that I can SOQL-query Objects, Fields, ApexPage, ApexComponent, but how do I find which of the results are those deletable items. They still look the same and now have a Delete button enabled in the Setup.

NOTE: Still fully unsolved. None of the answers helped to solved this.

  • 1
    I've been thinking that you might be able to achieve something using the Metadata API using the InstalledPackage. Not sure if you can get the list of components that way. Oct 9, 2017 at 22:21
  • 1
    1. Does SELECT Id, DeveloperName, NamespacePrefix FROM EntityDefinition WHERE IsDeprecatedAndHidden = true give you anything meaningful? Documentation for this table exists only in Tooling API section but the query works in SOQL all right. 2. Do you see something suggesting the act of removal in SetupAuditTrail? It also can be queried (although it's next to impossible to write WHEREs for it).
    – eyescream
    Oct 10, 2017 at 10:30
  • @RobertSosemann - I delete the answer per your request and because I could not recall the org I tested it in since it was a few weeks ago. If you find that it finally works for you let me know and I will undelete it. All I can recall now is that I tested it before I posted but my test may have been flawed so going with your lead here
    – Eric
    Oct 18, 2017 at 0:02
  • @eyescream IsDeprecatedAndHidden always returns true but looks promising to get used in the future exactely for that. Oct 18, 2017 at 22:12

1 Answer 1


Cannot see an Apex only way to do this. A rough idea instead: Add your package XML twice as static resource in consumable format: before and after deletion. In the same manner you could provide a destructiveChanges.xml to costumers.

You must log in to answer this question.

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