Skip to main content
Trailblazer Community 现已在 Slack 开启公开测试版。欢迎加入并实时交流。加入 Slack

Package Data 360 Functionality

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe the purpose of scratch orgs, Dev Hub orgs, and namespace orgs.
  • Package and install Data 360 features using second-generation managed packaging.

Set Up Managed Packaging for Data 360

The Get Cloudy Consulting team has planned out their Data 360 project and are excited about the enhanced developer experience through 2GP. And they’re ready to do most of their development in their partner business org.

In this unit, you learn how to set up managed 2GP. Learn more about the process in Workflow for Data 360 Second-Generation Managed Packages.

Note

The steps in this badge are performed in a partner business org by a Data 360 architect or admin. Data 360 features are not available in standard Trailhead Playgrounds.

Configure Dev Hub and Namespace Org

Get Cloudy needs a Dev Hub and a namespace org. A Dev Hub org is an org used to create, manage, and track scratch orgs and 2GP package versions. A namespace org is a Developer Edition org where you specify the namespace you’d like to use for your packages to ensure component prefix protection.

Here’s how to do it.

  1. In the partner business org, enable the Dev Hub and second-generation managed packaging.
  2. Create a namespace org, and define 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.

Enable Data 360 for Scratch Orgs

Next, the Get Cloudy team needs to enable Data 360 for scratch orgs in their partner business org. This lets them use Data 360 metadata in scratch orgs or to package a data kit. A scratch org is a source-driven and disposable deployment of Salesforce code and metadata.

If Data 360 for scratch orgs isn’t enabled in your org, log a case with Salesforce Partner Support, and request that Data 360 for scratch orgs be enabled on your partner business org. Data 360 for scratch orgs is only available to scratch orgs associated with the Dev Hub in your partner business org.

Create a Project

In their local directory, Get Cloudy creates a Salesforce DX project.

sf project generate -n shoe-vendor-data360

Configure Project Files

  1. Open the project in VS Code and update key project files.
    • sfdx-project.json—Set the correct namespace and login URL.
    • config/project-scratch-def.json—Define scratch org settings and feature flags.
    • .forceignore—Add ssot to prevent standard system Data Model Objects from being retrieved into your source repository.
  2. In the project-scratch-def.json file, enable the required Data 360 settings and features. Here is a sample proj-scratch-def.json file that can be used.
{
 "orgName": "Salesforce",
  "edition": "Developer",
  "features": [
    "EnableSetPasswordInApi",
    "CustomerDataPlatform",
    "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

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈