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.
-
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.
-
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
andEnablement
.If the program is for Partner Enablement in an Experience Cloud site, also include the scratch org features
EnablePRM
andCommunities
.Communities
also requires the CommunitiesSettings scratch org setting whereenableNetworkEnabled
istrue
. -
Retrieve these metadata types for the Enablement programs and dependencies that you want to package.
-
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.
-
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 measuresnetworks
, if a program is for Partner Enablement in an Experience Cloud sitedigitalExperienceBundles
, 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.
- 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
- 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 classesobjects
for the standard object LearningItem with a custom field and the custom objectenblProgramTaskSubCategories
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.
-
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 thesfdcEnablement_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.- Change the value of
<label>
to a unique workspace name. - Change the value of
<description>
to a new description of the workspace. - In
sfdcEnablement_EnablementWorkspace.digitalExperience-meta.xml
, change thesfdcEnablement_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 namecustomWorkspaceName
, rename the file tocustomWorkspaceName.digitalExperience-meta.xml
.
- Change the value of
-
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.
-
Update your Salesforce DX project file to include the required permission set licenses for accessing the metadata types.
-
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.
-
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. -
Test and verify the package.
-
Promote the package to released status.
See Also
- Salesforce DX Developer Guide: Scratch Orgs
- Second-Generation Managed Packaging Developer Guide: Project Configuration File for a Second-Generation Managed Package
- Salesforce CLI Command Reference: package Commands