Add the #DF24 Developer Keynote to your agenda. Join us in-person on 9/18 at 2:30 p.m. PT or on Salesforce+ at 5 p.m. PT for the must-see session built just for developers.

Create a Managed Package for Enablement Programs, Measures, and Content

To package Enablement programs and their dependencies, set up your source org environment and project settings for Enablement data, retrieve the appropriate metadata, and create the package.

Before you create a package, review the considerations for packaging Enablement programs and dependencies. If the program includes Feedback Request exercises for peer and manager feedback, first package the assessment surveys separately.

In your Salesforce DX project, add the required scratch org features and settings, and retrieve the metadata related to the programs that you want to package.

  1. Set up your source org for creating second-generation managed packages.

    To learn about setup options, see Second-Generation Managed Packages in the Second-Generation Managed Packaging Developer Guide.

  2. In your scratch org definition file, include these scratch org features and settings that you need for programs.

    See Build Your Own Scratch Org Definition File in the Salesforce DX Developer Guide.

    For all programs, include the scratch org features GuidanceHubAllowed and Enablement.

    If the program is for Partner Enablement in an Experience Cloud site, also include the scratch org features EnablePRM and Communities. Communities also requires the CommunitiesSettings scratch org setting where enableNetworkEnabled is true.

  3. Retrieve these metadata types for the Enablement programs and dependencies that you want to package.

    • EnablementProgramDefinition

    • EnablementMeasureDefinition, if a program includes an outcome and milestones that reference Enablement measures

    • Network, if a program is for Partner Enablement in an Experience Cloud site

    • DigitalExperienceBundle, if a program includes exercise content from the Enablement workspace in the Digital Experiences app

      Retrieve content only from the Enablement workspace. Don't retrieve content from other workspaces. Include this entry in your package.xml file.

      Because only content with a status of Published can be used in a program, all content included in the package is set to Published when the package is installed. This is different behavior from when you package Digital Experiences content outside the Enablement workspace, where you can package and deploy content of other statuses. When you retrieve content to include in a package, take care to retrieve only the content from the Enablement workspace.

  4. In your Salesforce DX project’s force-app/main/default directory, verify that you have these folders for the metadata components that you’re including in the package.

    • enablementProgramDefinitions
    • enablementMeasureDefinitions, if a program includes an outcome and milestones that reference measures
    • networks, if a program is for Partner Enablement in an Experience Cloud site
    • digitalExperienceBundles, if a program includes exercise content from the Enablement workspace in the Digital Experiences app

If a program includes custom exercise types, retrieve additional required metadata types and include them in your project. See Create Custom Exercises for Enablement Programs.

  1. Retrieve these metadata types.
    • ApexClass, for the evaluation handler, serializer, and deserializer classes associated with a custom exercise type
    • CustomObject, for the custom object associated with a custom exercise type
    • CustomField, for the custom field on the LearningItem object
    • EnblProgramTaskSubCategory and LearningItemType, for the custom exercise definitions in Program Builder and Guidance Center, respectively
    • LightningComponentBundle, for the custom Lightning web components associated with a custom exercise type
  2. In your Salesforce DX project’s force-app/main/default directory, verify that you have these folders for the metadata components that you’re including in the package.
    • classes for Apex classes
    • objects for the standard object LearningItem with a custom field and the custom object
    • enblProgramTaskSubCategories
    • learningItemTypes
    • lwc for the Lightning web components

In your project, update the retrieved metadata for Digital Experiences content related to program exercises, and update the program metadata that references that content.

  1. In the digitalExperienceBundles folder, change the name of the workspace that’s installed in the destination org. Because the destination org has an Enablement add-on license, the destination org also has the default Enablement workspace with the sfdcEnablement_EnablementWorkspace API name. To avoid conflicts with that default namespace in the destination org, specify a unique name and API name for the workspace that the package installs.

    1. Change the value of <label> to a unique workspace name.
    2. Change the value of <description> to a new description of the workspace.
    3. In sfdcEnablement_EnablementWorkspace.digitalExperience-meta.xml, change the sfdcEnablement_EnablementWorkspace portion of the filename, which is the API name of the Enablement workspace in the source org. For example, to use the custom workspace API name customWorkspaceName, rename the file to customWorkspaceName.digitalExperience-meta.xml.
  2. In the enablementProgramDefinitions folder, update the retrieved program metadata to reference Digital Experiences content by the new workspace API name.

    For example, let's say that an EnablementProgramDefinition component includes this reference to a Link content record.

    Replace the default workspace API name with the custom workspace API name that you specified.

The <apiName> element is used when you retrieve program metadata in API version 62.0 and later.

If you retrieved program metadata in API version 61.0, the program’s references to Digital Experiences content use the <contentKey> element instead. Update these references so that they use the <apiName> value, and include the custom workspace API name.

Specify the required permissions in your project file, then create, test, and promote your package.

  1. Update your Salesforce DX project file to include the required permission set licenses for accessing the metadata types.

  2. If you created a separate package for assessment surveys, add a dependency on the assessment survey's package in the program's package. See Create Dependencies Between Second-Generation Managed Packages in the Second-Generation Managed Packaging Developer Guide.

  3. Create a package version. To include the appropriate features in the destination org, reference the scratch org definition file you created. Add the definitionFile parameter in your project configuration file, or use the --definition-file flag from the command line.

  4. Test and verify the package.

  5. Promote the package to released status.

See Also