Skip to main content
Stream TDX Bengaluru on Salesforce+. Start learning the critical skills you need to build and deploy trusted autonomous agents with Agentforce. Register for free.

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.

Note

A Dev Hub org is an org that manages scratch orgs used in development and testing. A namespace org is a Developer Edition org where you specify the namespace you’d like to use for your packages.

  1. In the Partner Business Org, enable the Dev Hub and second-generation managed packaging.
  2. Create a namespace org, and specify a namespace in that org.
  3. 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.

  1. 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.
  2. In the proj-scratch-def.json file, specify the feature “CustomerDataPlatform” in the proj-scratch-def.json file. Below is a sample proj-scratch-def.json file that can be used.
{
  "orgName": "Salesforce",
  "edition": "Developer",
  "features": ["EnableSetPasswordInApi","CustomerDataPlatform","CustomerDataPlatformLite","MarketingUser"],
  "settings": {
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    },
    "mobileSettings": {
      "enableS1EncryptedStoragePref2": false
    },
    "customerDataPlatformSettings": {
      "enableCustomerDataPlatform": true
      }
  }
}

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:

sf org create scratch -a SCRATCH_ORG_NAME -f config/project-scratch-def.json -w 10 -v DEVHUB_ALIAS

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

Partagez vos commentaires sur Trailhead dans l'aide Salesforce.

Nous aimerions connaître votre expérience avec Trailhead. Vous pouvez désormais accéder au nouveau formulaire de commentaires à tout moment depuis le site d'aide Salesforce.

En savoir plus Continuer à partager vos commentaires