1

In the past, we've heard from our Salesforce Support team that certain managed packages in our org may be impacting execution times on key transactions. Business teams recently reported these execution times going up, but the timing doesn't seem to coincide with any recent internal changes. We're suspicious that one of our (many) managed package vendors may have upgraded their code, but unsure how to confirm this.

Some questions come up:

  • The managed package detail page shows a "Modified By" field, which includes a date. Is this reliable as a "last upgraded date"?
    • If so, is there any way to query for this across all our managed packages, so we don't have to scrape the UI?
  • Is Event Monitoring a possible solution here? It appears there is a Package Install Event Type available. Does it provide the necessary info to monitor when vendors push an upgrade?
  • Any other relevant options I'm missing?

Related reading:

2

The Modified By and Modified Date in the UI is a reliable matrix to know the package was last upgraded!

But this also means for all the packages you will have to scrape the UI and not ideal.

There is also a better alternative if you want to use workbench or Salesforce CLI for this.

Here are the steps for it. Note that you will need to use tooling API for this. If you use Salesforce CLI tooling query can be executed using below

sfdx force:data:soql:query --usetoolingapi

Fetch all the InstallPackage Requests via SOQL, shows everything that was upgraded, installed or released via patch

 Select UpgradeType, Status, 
    SecurityType, PackageInstallSource, ApexCompileType, 
    SubscriberPackageVersionKey, 
    LastModifiedDate,LastModifiedById,
    SubscriberPackageVersion FROM PackageInstallRequest

Each of these, you will need to find the SubscriberPackageVersion and the package name. Requires one more SOQL like below

SELECT Id, SubscriberPackageId, SubscriberPackage.NamespacePrefix,
  SubscriberPackage.Name, SubscriberPackageVersion.Id,
  SubscriberPackageVersion.Name, SubscriberPackageVersion.MajorVersion,
  SubscriberPackageVersion.MinorVersion,
  SubscriberPackageVersion.PatchVersion,
  SubscriberPackageVersion.BuildNumber,LastModifiedDate
 FROM InstalledSubscriberPackage
 ORDER BY SubscriberPackageId

Is Event Monitoring a possible solution here? It appears there is a Package Install Event Type available. Does it provide the necessary info to monitor when vendors push an upgrade?

Yes, this could be an option but will require you to implement using the Event Monitoring API. There is no UI today and you will need to implement one.

Looks like standard functionality and UI are limited here however you can use these APIs and build an object to keep track of all the package installed requests in your system and display in the standard report.

1
  • This definitely gets me most of the way there, thanks! Notes: A) The relevant fields on PackageInstallRequest` appear to be SubscriberPackageVersionKey (argh, why is this not a normal lookup Id??) and LastModifiedDate, B) SubscriberPackageVersion is not a valid field on PackageInstallRequest, C) my query for InstalledSubscriberPackage turned up empty, D) you can query SubscriberPackageVersion instead, but you have to include an Id in the WHERE clause, and E) these Tooling API queries can also be done in the Developer Console Aug 6 '20 at 18:01

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.