Dynamics CRM 之团队模板

位置:设置——安全性——访问团队模板

实体:关联实体,若关联了实体,相关关联的角色可以对当前实体进行下列访问权限的操作;

团队模板的赋值:

插件代码

//通过团队模板名称获取团队模板

var teamtemplate = ef.GetEntity(service, "teamtemplate", new ColumnSet("teamtemplatename"),
new List<ConditionExpression> {new ConditionExpression("teamtemplatename",ConditionOperator.Equal, "团队模板名") });

//对团队模板添加记录

(Record当前记录,SystemUserId 相关用户id,TeamTemplateId 团队模板id)

private void AddToTeam(Entity data, Guid uid, Entity teamtemplate)
{
    var addToTeamRequest = new AddUserToRecordTeamRequest()
    {
        Record = data.ToEntityReference(),
        SystemUserId = uid,
        TeamTemplateId = teamtemplate.Id,
    };
    service.Execute(addToTeamRequest);
}

new RemoveUserFromRecordTeamRequest()的方法用于删除团队模板的值

子网格(关联记录团队成员)中的用户将有所选的访问权限对这条记录进行操作

增加团队模板的启用个数:

 Run following query on MSCRM_CONFIG database
select * from DeploymentProperties where ColumnName ='MaxEntitiesEnabledForAutoCreatedAccessTeams'

To Update MaxEntitiesEnabledForAutoCreatedAccessTeams  setting run
update DeploymentProperties set IntColumn = 6 where ColumnName ='MaxEntitiesEnabledForAutoCreatedAccessTeams'
 

这种东西非常坑爹啊,每次迁移默认解决方案到其他服务器,都需要对被迁移的环境中对子网格进行删除,重新配置,这样才能生效!

好问题来了。既然这么烦,那为什么还要用这个东西,而且还不止一个!

原因1:客户奇葩的需求!

原因2:开发时逻辑和业务上的缺陷!

原文地址:https://www.cnblogs.com/SilverWolf/p/6590888.html