Prerequisites for Workshop One: Building Managed Packages with SFDX
Step One: Install the Salesforce CLI
Why? The Salesforce CLI is at the heart of Salesforce DX. Almost everything we do will involve the CLI in one way or another.
- Visit https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
- Follow the instructions that are specific to your Operating System (macOS, Windows, or Linux)
- Make sure you read and follow the instructions for “Verify Your Installation” (second to last section on the page) to ensure that you’ve correctly installed the CLI
Step Two: Install Visual Studio Code
Why? Visual Studio Code (VS Code) is the official IDE for Salesforce development (ie. no more Eclipse). Almost all of the exercises will use VS Code in one way or another.
- Visit https://code.visualstudio.com/Download
- Download the installer for your Operating System
- Run the installer once it’s downloaded to your machine
Step Three: Install the Salesforce Extensions for VS Code
Why? VS Code is the IDE, but the Salesforce Extensions for VS Code actually let you talk to the Salesforce CLI. Luckily, installing plugins with VS Code is a breeze.
- Visit https://developer.salesforce.com/tools/extension_vscode
- Follow all of the steps listed under “Getting Started”
Step Four: Make sure the Developer Hub Feature is Enabled in Your PBO
Why? Dev Hubs inside of Partner Business Orgs (PBOs) have special entitlements that other DevHubs don’t get. While you can complete Workshop One with a DevHub from a trial or DE org, you should use the DevHub in your PBO, if possible.
- Login to your PBO (Partner Business Org)
- NOTE: If you do not have access to your company’s PBO, you can use a new trial or DE org as your Dev Hub instead of your PBO. If you go this route, remember that you’ll be limited to 3/6 active/daily scratch orgs.
- Open Setup and type “Dev Hub” in the Quick Find search box
- IMPORTANT: If you do not have the Dev Hub feature available in Setup, please use the following troubleshooting steps
- Make sure the org you’re in is really your PBO and not a random org that you think is your PBO
- Open a case with support and ask them to activate the Dev Hub in your PBO and provide you with the appropriate entitlements (exact entitlements will depend on your partner status)
- IMPORTANT: If you do not have the Dev Hub feature available in Setup, please use the following troubleshooting steps
- Click on the Dev Hub setup item
- If it’s not already enabled, flip the switch to enable the Dev Hub
Step Five: Make Sure That Your Dev Hub Org has “My Domain” Setup
Why? One of the key features of Salesforce DX for ISVs is the linking of a packaging org’s namespace to your Developer Hub in order to create “namespaced scratch orgs”. To make this work, your Dev Hub org must have My Domain enabled and deployed to users.
- If not already configured, setup My Domain for your Dev Hub (PBO) org by following these instructions: Define your MyDomain Subdomain Name
- If you are setting up My Domain now, you must deploy it to users after turning it on. You can do that by following these instructions: Test and Deploy Your New My Domain Subdomain
Step Six: Create a NEW Developer Edition Org
Why? This DE (Developer Edition) org will be used during the workshop to build a simple managed package. Creating it ahead of time will let us move quickly through the exercises during the workshop.
IMPORTANT: Please make sure you create a NEW DE org so you can start with an empty managed package. Please do not try to use a previously existing DE or Packaging org.
- Use your Environment Hub to create a Partner Developer Edition (PDE) or standard Developer Edition (DE) org.
- If you’re having any issues with your Environment Hub, you can also go to https://developer.salesforce.com/signup to get a standard DE org
- IMPORTANT: You must create a Developer Edition org (either PDE or DE) because you’ll be using it later to create a managed package
- Register a Namespace Prefix for your DE org by following the instructions on this page: https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/register_namespace_prefix.htm
- Create an empty managed package named “My Managed Package” by following Step #1. Create a Package about halfway down this page: https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/packaging_uploading.htm
- IMPORTANT: Do not add any components to your package and do not upload a package version. We’ll do that together during the workshop.