Install Manage Package using SFDX in Scratch Org

Install Manage Package in Scratch Org using Salesforce DX

There are tons of useful SFDX commands available to help automate Salesforce deployment. However one of most important aspect of Salesforce DX is capability of spinning org within few minutes with features enabled like Person Account, Communities etc.

There could be times, where these commands might not be sufficient. I recently cam across such scenario where I wanted to install manage package for quick capability check.

Scanned through documentation, Stack Exchange and spent lots of time figuring out on how to automate package installation. There are many commands available to install second generation package but not manage package itself. Then I came across marty chang’s github repository with instruction.

Here is what we need to do :

Create a folder named installedPackages in force-app/main/default folder.

For this blog post, we would be installing Salesforce CPQ, place below file in installedPackages folder with name SBQQ.installedPackages-meta.xml

<?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>216.10.1</versionNumber>
</InstalledPackage>

As you can see, file naming convention is <managepackagenamespace>.installedPackages-meta.xml

Example of Field Service Lightning , file name FSL.installedPackage-meta.xml

<?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>4.0.17</versionNumber>
</InstalledPackage>

Example of B2B Commerce Cloud, file name ccrz.installedPackage-meta.xml

<?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>3.133.2</versionNumber>
</InstalledPackage>

Related Posts

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading