function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
FilikinFilikin 

Salesforce DX - create a scratch org with npsp

Hi,
I am working with an org which has the NPSP and a few other packages installed.
Using the "old" development cycle, I created a sandbox from the org, made my changes in eclipse and pushed the changes to production.
Now I want to use scratch orgs.
So I created a scratch org, used my package.xlm file from Eclipse to retrieve the config from the sandbox, converted it to the new format and attempted to push it to the scratch org.
However the config is dependent on fields that are part of the NPSP, so do I have to install all the packages that are in the sandbox manually into the scratch org before I can start development?
This seems to break the idea of a fast turnround - am I missing something?
Best Answer chosen by Filikin
FilikinFilikin
I got the following solution from Judi Sohn of the NPSP team:
Good news is that this is already possible. Can't do with Salesforce DX out of the box. You do need to leverage the open source Cumulus CI framework http://cumulusci.readthedocs.io/en/latest/index.html Once you're set up, then you can just add NPSP as a dependency for your project through the appropriate task. http://cumulusci.readthedocs.io/en/latest/features.html

All Answers

James LoghryJames Loghry
Hi there,

Here's a thread on Salesforce Stackexchange on the same topic: https://salesforce.stackexchange.com/questions/185840/how-to-install-managed-package-using-salesforce-dx-cli.

Long story short, you'll want to find the Id of the package version you're needing to install and then use the following command:
sfdx force:package:install -i <id>  -u <your scratch org alias>
Raghu Rao 12Raghu Rao 12
There is an issue with NPSP installation because it takes you to the NPSP site for installation and as a result you never get the screen where one could capture the AppID for the Non Profit Package.
FilikinFilikin
I think we need a script from the NPSP developers - I wonder if any of them are using DX
FilikinFilikin
I got the following solution from Judi Sohn of the NPSP team:
Good news is that this is already possible. Can't do with Salesforce DX out of the box. You do need to leverage the open source Cumulus CI framework http://cumulusci.readthedocs.io/en/latest/index.html Once you're set up, then you can just add NPSP as a dependency for your project through the appropriate task. http://cumulusci.readthedocs.io/en/latest/features.html
This was selected as the best answer
Dave_BoyceDave_Boyce
Thanks @Filikin,
1) Edit cumulusci.yml (add the following)
	dependencies:
	    # npe01
	    - github: https://github.com/SalesforceFoundation/Contacts_and_Organizations
	
2) cci task run update_dependencies
The above two commands were all that was needed to get NPSP included in the Scratch Org.
 
sfwizardsfwizard
I use the instructions specified in the link https://salesforcecodes.blogspot.com/2020/04/how-to-create-scratch-org-with-non.html (https://salesforcecodes.blogspot.com/2020/04/how-to-create-scratch-org-with-non.html)when I setup scratch org with NPSP. After initial setup I can just run one shell script, it will create scratch org, import npsp prerequisites, install all NPSP packages and import my code into scratch org.