Metadata Type: ReferencedDashboard
The ReferencedDashboard metadata type in Salesforce represents a dashboard that is referenced by another component, typically within a Lightning page or app. This metadata type allows administrators and developers to include existing dashboards in various parts of the Salesforce interface, providing users with quick access to important metrics and visualizations.
Key Characteristics
ReferencedDashboard is a subtype of the broader Dashboard metadata type. It inherits many properties from its parent type but has some unique attributes:
- It is used specifically when a dashboard is referenced or embedded in another component
- It contains information about how the dashboard should be displayed when referenced
- It may include settings for filtering and visibility within the context it's used
Usage in Salesforce
Administrators and developers use ReferencedDashboard in several scenarios:
- Embedding dashboards in Lightning pages to provide contextual data visualizations
- Including dashboards in Lightning apps for quick access to key metrics
- Referencing dashboards in custom components or Visualforce pages
- Creating dynamic dashboards that can be filtered based on the context they're viewed in
Deployment Considerations
When working with ReferencedDashboard metadata, there are several important considerations for deployment:
1. Dashboard Existence
The referenced dashboard must exist in the target org. If the dashboard doesn't exist, the deployment will fail. Ensure that the dashboard being referenced is included in the deployment package or already exists in the target environment.
2. Folder Permissions
The folder containing the referenced dashboard must be accessible to the users who will view it. During deployment, verify that folder permissions are correctly set in the target org to avoid visibility issues.
3. Running User
If the referenced dashboard is configured to run as a specific user, ensure that the user exists in the target org and has the necessary permissions. If the specified running user doesn't exist, consider updating the dashboard settings to use a different user or "Run as logged-in user" option.
4. Component Dependencies
ReferencedDashboard may have dependencies on other components such as custom fields, report types, or Apex classes. Include all necessary dependencies in the deployment package to ensure proper functionality.
5. API Version Compatibility
Ensure that the API version used in the source org is compatible with the target org. Mismatches in API versions can lead to deployment failures or unexpected behavior.
Best Practices for Salesforce Administrators
To effectively work with ReferencedDashboard metadata, Salesforce administrators should follow these best practices:
1. Use Descriptive Names
When referencing dashboards, use clear and descriptive names that indicate the dashboard's purpose and context. This makes it easier to manage and understand the relationships between components.
2. Implement Version Control
Use a version control system to track changes to ReferencedDashboard metadata. This allows for easier rollback and collaboration among team members.
3. Document Dependencies
Maintain documentation of all dependencies for referenced dashboards, including reports, custom fields, and any Apex code. This documentation will be invaluable during deployments and troubleshooting.
4. Regular Validation
Periodically validate referenced dashboards to ensure they still meet the intended purpose and haven't been adversely affected by other changes in the org.
5. Use Sandboxes for Testing
Always test deployments involving ReferencedDashboard metadata in a sandbox environment before moving to production. This allows you to catch and resolve any issues without impacting users.
6. Leverage Packaging
When possible, use packaging to group related components, including ReferencedDashboard metadata. This ensures that all necessary components are deployed together and maintains their relationships.
7. Monitor Performance
Regularly monitor the performance of referenced dashboards, especially in contexts where they are frequently loaded. Optimize dashboards that may be causing slowdowns in Lightning pages or apps.
8. Use Dynamic Dashboards Judiciously
While dynamic dashboards offer flexibility, they can impact performance. Use them only when necessary and consider the implications on system resources.
9. Implement Proper Security
Ensure that referenced dashboards adhere to your org's security model. Use sharing rules, field-level security, and folder permissions to control access to sensitive data.
10. Stay Updated
Keep abreast of Salesforce releases and updates that may affect ReferencedDashboard functionality. New features or changes may provide opportunities for optimization or require adjustments to existing implementations.
By following these best practices and being mindful of deployment considerations, Salesforce administrators can effectively leverage the ReferencedDashboard metadata type to create rich, data-driven experiences for their users. Proper management of this metadata type ensures that dashboards are seamlessly integrated into various parts of the Salesforce interface, providing valuable insights and improving user productivity.