11

My managed package is extensively customized and extended by some customers in their org. For our packaged objects they e.g. add

  1. Triggers + Custom Apex code
  2. Fields
  3. Validation Rules
  4. Workflows
  5. Process Builder processes

I learned the hard way how such customizations can degrade packaged functionality (perfectly described in this Dreamforce session). To better know how much customization there is I planned on displaying this info on a page to the customer. My question now is:

How can I use the Metadata / Tooling API to find dependencies of my packaged objects?

Some of these informations can be queried using a SOQL on ApexPage, ApexTrigger and others, but is there a way for all the other relevant metadata types?

2
  • 3
    I'm not sure if this is possible, but maybe you could try a destructiveChanges.xml deploy + validation only flag, then you'd get a list of errors? – sfdcfox Jan 9 '17 at 17:11
  • 1
    Salesforce launched a Pilot for dependency API. releasenotes.docs.salesforce.com/en-us/summer18/release-notes/… Let's hope soon we won't have to put in kludges with a destructive changes :) – nchursin Aug 19 '18 at 16:48
2

The best way to do this is to use listMetadata() to quickly get the names of various components by type. You will have to search for your package namespace prefix in the returned names to see the unpackaged customizations.

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_listmetadata.htm

The problem with this method is that there will be uncertainty as to where the customizations might reside, and there are 200 metadata types. But it sounds like you have an idea where to look.

Also, you can experiment with the new metadataComponentDependency() tooling API. This will allow you to look instead at your packaged objects and see the dependencies.

https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_metadatacomponentdependency.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.