Package Data Cloud Functionality
Learning Objectives
After completing this unit, you’ll be able to:
- Describe the advantages of second-generation managed packaging for Data Cloud apps.
- Package and install Data Cloud features using second-generation managed packaging.
Set Up Managed Packaging for Data Cloud
The Get Cloudy Consulting team has planned out their Data Cloud project and is excited about the enhanced developer experience through 2GP. They have a Partner Business Org in which they’ll be doing most of their development.
In this unit, you learn how to set up managed 2GP. A more detailed step-by-step process is located in the Data Cloud Developer Guide, Workflow for Data Cloud Second-Generation Managed Packages.
We assume you’re a Data Cloud admin, but if you’re not, that’s OK. Read along to learn how your administrator would take the steps in a Partner Business Org. Don’t try to follow these steps in your Trailhead Playground. Data Cloud isn’t available in a typical Trailhead Playground.
Enable Data Cloud for Scratch Orgs
The first step the Get Cloudy team takes is to enable Data Cloud for Scratch Orgs in their Partner Business Org. This lets them use Data Cloud metadata in scratch orgs or to package a data kit.
If Data Cloud for Scratch Orgs isn’t enabled in your org, log a case with Salesforce Partner Support, and request that “Data Cloud for Scratch Orgs” be enabled on your Partner Business Org. Data Cloud for Scratch Orgs is only available to scratch orgs associated with the Dev Hub in your Partner Business Org.
Create a Dev Hub and Namespace Org
Get Cloudy needs a Dev Hub and a namespace org. Here’s how to do it.
- In the Partner Business Org, enable the Dev Hub and second-generation managed packaging.
- Create a namespace org, and specify a namespace in that org.
- In the Dev Hub org, register the namespace.
Set Up Your Development Environment
Get Cloudy checks that it has the necessary development tools. If you’re new to developing in Salesforce, you must install Salesforce CLI, Visual Studio Code (VS Code), and the Salesforce Extension Pack for VS Code. Learn more about Salesforce Developer Experience by taking the Build Apps Together with Package Development trail, or learn more about these developer tools through the Set Up Your Workspace and Install Developer Tools trail.
Create a Project
In their local directory, Get Cloudy creates a Salesforce DX project.
- Open the project in VS Code and modify the
sfdx-project.json
,config/project-scratch-def.json
, and.forceignore
files to have the correct namespace, login URL, orgName, and a **ssot** line. - In the proj-scratch-def.json file, specify the feature “CustomerDataPlatform” in the
proj-scratch-def.json
file. Below is a sampleproj-scratch-def.json
file that can be used.
Create a Scratch Org
To create the scratch org, Get Cloudy enters the following in their command line, making sure to specify the scratch org definition file:
Now that Get Cloudy has its scratch org created, the team can begin creating their data kit. In the next unit, you learn how to create a data kit with all the features you want, and then package it.
Resources
- Salesforce Developer: Create a Second-Generation Managed Package
- Salesforce Developer: Prepare to Distribute Your Second-Generation Managed Package
- Salesforce Developer Blog: Get Started with Modern AppExchange Development
- Salesforce Developer: Workflow for Data Cloud Second-Generation Managed Packages
- Trailhead: Second-Generation Managed Packages