Make a "PackageInfo" Apex class available for managed code to call at runtime - Ideas - Salesforce Trailblazer Community
Trailblazer Community

All Ideas

Idea Details

Post an Idea
This idea has been merged into another idea. To comment or vote on this idea, please visit Expose API / Objects for assigning Managed Package Licenses to Users.
0  Points voting closed

Make a "PackageInfo" Apex class available for managed code to call at runtime


Managed packages have limited visibility to the users actually assigned to that package and other information.

I suggest a new Apex class called PackageInfo be available at runtime. It could be restricted to only be available from code in the non-system namespace and only return data about the namespace its running in.

Think of it like you might UserInfo, but it's available for your own code to help understand your package and how its implemented. The package should make relevant information available like...
  • Current License Status (String)
  • Current License Expiration Date (Date)
  • IDs of Licensed Users (List<ID>)
  • IDs of Profiles of the Licensed Users (List<ID>)
  • Namespace (String)
  • Version Info (custom Version class?)
  • LMA oAuth Token to give us a mechanism for talking directly back to our LMA org using the REST API. Long shot, I know, but would be handy.

For example, I'd be able to add code like...

IF (PackageInfo.getLicenseStatus() == 'Trial') {
     // add more help info to the page and guide the user more


· Flag

  • Upvotes
  • Downvotes



from AppExchange


No results found.

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.