Understanding Managed Package Creation with CRM Analytics Components
You can create managed packages of CRM Analytics assets, including CRM Analytics apps, dashboards, datasets, recipes, dataflows, and user XMD. Use packages to distribute those assets to other users within or outside your company. However, it is important to understand the functionality of creating a Managed Package in the org, especially when it includes CRM Analytics components. Not doing so can cause multiple issues for subscribers and developers after the package version is released.
Best Practices for Managed Packages with CRM Analytics
Whenever you create a managed package, the best practice is to avoid including individual datasets, dataflows, and other CRM Analytics assets. Here’s an example to illustrate this:
Example Scenario
You create a Managed Package with custom fields and objects and add them to the dataflows/datasets. During package installation, the Integration User will need access to those fields, and these fields must already exist in the org for the installation to succeed.
- Issue: If the fields don’t pre-exist in the org, the installation will fail with a Salesforce Internal error.
- Solution: To avoid this, it is recommended not to include the individual datasets, dataflows, and assets in the same Managed Package.
Recommended Solutions
You have two primary approaches to handle this:
- Create the dataflows and datasets manually after the package is installed.
- Create one package for the core components (objects and fields) and another for the individual datasets, dataflows, and other assets.
Avoid manually packaging individual datasets, dataflows, and other assets
Use app templates to manage analytics assets. App templates make it easy to manage asset references and the unique org IDs, names, and schemas that make up a dataset.
Understand dataset and dataflow dependencies in packages
- Datasets and dataflows are independent and must be manually added to a package.
- Datasets from managed packages can’t be used in dashboards as a connected data source.
- Invalid schema overrides and unsupported parameters are removed when adding a dataflow to a package. Also, comments in JSON are removed, and node ordering can change.
- Source and security predicates aren’t included in a package when adding a dataflow to a package.
- Datasets are linked to recipes. To package a recipe, create a dataset with the recipe. Then, add the related dataflow to the package along with the recipe.
Important Considerations –
- All custom fields used in a deployed dataflow must exist in the target org. The Analytics Cloud Integration User must have access to these custom fields. For example, if you are creating a Patch Org for a specific version of the Managed Package containing dataflows/datasets, the process will fail if the fields don’t already exist in the Patch Org. This is because these fields will be deployed alongside other package components, causing the overall process to fail.