我想在线配置 Dynamics CRM 2011,以便它默认显示特定用户角色的特定仪表板。是否可以通过某些设置或使用插件或 JavaScript 编写自定义代码来实现?
例如,如果首席执行官约翰登录 - 他应该看到年收入仪表板,如果销售人员登录,他们会看到销售线索仪表板。
仪表板是公共仪表板,而不是个人仪表板。
如果您有本地版本,最快的方法可能是访问数据库表UserSettingsBase
并更新DefaultDashboardId
列到您希望每个用户拥有的仪表板的 GUI。 (编辑 - 刚刚意识到您正在使用 CRM Online,因此这不适用。)
您可以通过实例化 API 框架来完成相同的任务UserSettings
为每个用户找到合适的实体roleid
,并更新DefaultDashboardID
的财产UserSettings
实体。下面是一个例子。
using (OrganizationServiceProxy _serviceProxy = new OrganizationServiceProxy(new Uri("Your CRM Server"), null, null, null))
{
_serviceProxy.EnableProxyTypes();
using (OrganizationServiceContext osc = new OrganizationServiceContext(_serviceProxy))
{
var usersSettings = from u in osc.CreateQuery<SystemUser>()
join ur in osc.CreateQuery<SystemUserRoles>() on u.SystemUserId.Value equals ur.SystemUserId.Value
join r in osc.CreateQuery<Role>() on ur.RoleId.Value equals r.RoleId.Value
select new
{
id = u.SystemUserId.Value
, roleName = r.Name
};
foreach (var users in usersSettings)
{
UserSettings us = new UserSettings();
us.SystemUserId = users.id;
switch (users.roleName)
{
case "CEO":
us.DefaultDashboardId = Guid.Parse("2E3D0841-FA6D-DF11-986C-00155D2E3002"); //the appropriate dashboardid
break;
//case "Sales Person"
//case "..."
//default: ...
}
_serviceProxy.Update(us);
}
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)