I want to fetch the namespace prefix of all packages installed in a salesforce organization.How can I do that?

1 Answer 1


You didn't specify the use case, but you can call the Metadata API's listMetadata on the Package object to get a list of installed packages, which will include the namespacePrefix attribute. You can't do this in, for example, an Apex Code trigger, but you could use regular Apex Code, JavaScript, or any other language that supports the metadata API call (e.g. Java, .Net).

  • any way to get the installed package version number using apex?
    – Sonal
    Sep 12, 2014 at 11:35
  • You could use FF's Metadata API to get this info, but not inside a trigger, at least not without a metadata cache.
    – sfdcfox
    Sep 12, 2014 at 14:20

You must log in to answer this question.

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