7

Is it possible to get information on the package through APEX after it has been installed? Specifically I want to know the Status (see below)

installed package information

The reason I want this is because I want to show instructions how to purchase if the status is 'Trial'.

3 Answers 3

1

Unfortunately there is no way of obtaining this information from Apex. You do of course know this by running a report from within your LMO, so the info does exist, just not accessible in the subcriber org.

Unfortunately any callouts you make to your production org to obtain this information will also fail once the managed package is expired. The only thought I had was to perhaps send them an email via the UninstallHandler, assuming of course they bother to uninstall the package.

This really is quite a good observation though, "how can i notify my prospective customers that the software is about to expire?". Seems like a reasonable requirement to me, something that ought to be on IdeasExchange. If have no look and feel like raising one, I'll vote for it for you!

1
10

Kris, You can query all the installed packages on your org using following SOQL,

SELECT CreatedDate,ExpirationDate,Id,Status FROM PackageLicense WHERE NamespacePrefix = 'XXX'.

The PackageLicense object became available in api version 31.0.

Thanks,

0

Kris, I think you'll find the answer to your question in this message here on Stack Exchange.

You can use a call to UserInfo.isCurrentUserLicensed('your_package_name') to check and see if the license for it has expired.

2
  • That is different to if the license is Trial or Active. If you call UserInfo.isCurrentUserLicensed('your_package_name') and the trial license is active, you will get true. I want to know the Installed Package Status which is different.
    – Kris Moyse
    May 13, 2013 at 15:15
  • As I see Andrew has posted, as noted in this page of the LMA docs, using the LMO is the only way I could find to obtain info on Installed Package Status.
    – crmprogdev
    May 14, 2013 at 18:17

You must log in to answer this question.

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