Is there a way to install earlier version of application (managed package) from appexchange but not the latest one available? Or can it be moved from another sandbox if it's installed/available there?
Thanks
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityYou cannot downgrade a package that has been already installed to an earlier version. You can only either upgrade or uninstall and reinstall the desired version.
If you have the install URL for an older version of the managed package then you can install it assuming that version hasn't been deprecated by the publisher.
The install URL will be something like: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t400000000000
I created a workaround for this matter, if you have the previous version installed in any environment, through this query:
SELECT Id, SubscriberPackageId, SubscriberPackage.NamespacePrefix,
SubscriberPackage.Name, **SubscriberPackageVersion.Id**,
SubscriberPackageVersion.Name, SubscriberPackageVersion.MajorVersion,
SubscriberPackageVersion.MinorVersion,
SubscriberPackageVersion.PatchVersion,
SubscriberPackageVersion.BuildNumber
FROM InstalledSubscriberPackage
ORDER BY SubscriberPackageId
After performing the query and locating the package in question, I get the value of the SubscriberPackageVersion.Id field and assemble the url myself:
Putting ID at the end of the URL to proceed with the installation of the previous version.
https://login.salesforce.com/packaging/installPackage.apexp?p0=**<ID_HERE>**
You can install any version using the MetadataAPI. You need to create a file in the installedPackages
directory with the filename in the format of namespace.installedPackage-meta.xml
with the contents in the format below
<?xml version="1.0" encoding="UTF-8"?>
<InstalledPackage xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<activateRSS>false</activateRSS>
<versionNumber>versionNumberOfChoice</versionNumber>
</InstalledPackage>
For example, if I wanted to install v2.66 of the Salesforce Labs timeline component, I create the a file timeline.installedPackage-meta.xml
in the installedPackages
directory of my package with the contents as below:
<InstalledPackage xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<activateRSS>false</activateRSS>
<versionNumber>2.66</versionNumber>
</InstalledPackage>
Please note that you cannot downgrade your installed version. You will need to uninstall the newer version if you are planning a downgrade.
force:package:install
is much more convenient than installedPackage for a modern deployment strategy.