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
guenthmnguenthmn 

How to find out which packages are installed in a apex call?

I like to change my apex code behavior depending on what other packages are installed in a org. Can I query for that? I don't seem to see a object for that?

 

Thanks,

 

Matt

Best Answer chosen by Admin (Salesforce Developers) 
A_SmithA_Smith
Only option is to run a dynamic describe call in apex (see dynamic apex) and look for the objects from the other packages.  The objects will be prefixed with their namespace.

All Answers

A_SmithA_Smith
We don't have a great way of doing this.  What is your use case?
guenthmnguenthmn

I like to integrate with a 3rd party package if installed,

 

if (it is available) {do this} else {do that}

 

Thanks,

 

Matt

A_SmithA_Smith
Only option is to run a dynamic describe call in apex (see dynamic apex) and look for the objects from the other packages.  The objects will be prefixed with their namespace.
This was selected as the best answer
guenthmnguenthmn
That will work as a workaround, thanks Matt