【前言】:在验证Sharing Settings中User Visibility Settings对记录访问的影响[14]时,创建dynamic dashboard供不同用户登进community按running user身份渲染dashboard数据,在保存dashboard时,报错如下:[Error: You reached the limit for dashboards run as the logged-in user.],此篇博客将探索什么是dynamic dashboard,限制与解决方案。
【什么是动态报表?】
When you create a dashboard, you can set it to "Run as logged-in user"; this means it’s a dynamic dashboard. When a dashboard runs as the logged-in user, it will display only the records that user has access to.
在Classic中,可以按下图设置动态报表:
在Lightning Experience (LEX)中,选项显示略有不同,但效果是一样的,如下图:
应用场景:
比如想通过Timesheet记录员工在某项目上的Total Work Hours,Specialist可以看到自己的总工时, Tech Lead可以看自己和下属的总工时,而Manager可以看到整个团队的总工时,这时候可以选用Dynamic Dashboard来呈现。当然当Dynamic Dashboard勾选了"Let authorized users change running user"或者"Let dashboard viewers choose whom they view the dashboard as",Manager就可以以下属业务Consultant的身份或者以Tech Lead的身份分别查看BA和Developer分别在项目上投入的时间。
【限制】:Report Limits, Limitations, and Allocations
Edition | Dynamic dashboards per org |
---|---|
Developer | 3 |
Enterprise | 5 |
Unlimited | 10 |
Performance | 10 |
【解决方案】:
1. 由于增加动态报表最大数量限制是一个付费的功能,你可以寻求Salesforce客户经理增加改限制,详见Increase 'Maximum Number of Dynamic Dashboards' limit;
2. 查找并销毁未使用的动态仪表板。常用做法是把未使用的动态报表改成静态 (Classic可选择"Run as specified user",LEX可选择"Me" / "Another person") 或直接删除并清空回收站。
【查找正在使用的Dynamic Dashboard】:Find the dynamic dashboards in my organization
方法1:报表法,关键步骤如下:
创建Dashboards自定义Report Type -> 创建报表并选择该Report Type,最终效果如下图:
方法2:使用SOQL查询
SOQL1: will return Dynamic Dashboards that are not in private folders.
SELECT Id, Title, FolderName, Type FROM Dashboard WHERE Type != 'SpecifiedUser'
SOQL2: will return Dynamic Dashboards that are in private folders.
SELECT Id, Title, FolderName, Type FROM Dashboard USING SCOPE allPrivate WHERE Type != 'SpecifiedUser'