摘要: 微软动态CRM专家罗勇 ,回复301或者20190123可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me!我的网站是 www.luoyong.me 。

因为编程时候可能常用到,我这里做个简单汇总,以后若有碰到常用的会继续增加。

1.  用户添加角色

orgSvc.Associate(
"systemuser",
userId,
new Relationship("systemuserroles_association"),
new EntityReferenceCollection(){
new EntityReference("role",roleId)
});

2. 用户移除角色

orgSvc.Disassociate(
"systemuser",
userId,
new Relationship("systemuserroles_association"),
new EntityReferenceCollection() { new EntityReference("role", roleId)
});

3. 负责人类型团队添加角色

orgSvc.Associate(
"team",
teamId,
new Relationship("teamroles_association"),
new EntityReferenceCollection() { new EntityReference("role", roleId)
});

4.负责人类型团队移除角色

orgSvc.Disassociate(
"team",
teamId,
new Relationship("teamroles_association"),
new EntityReferenceCollection() { new EntityReference("role", roleId)
});

5.私有队列加入用户

orgSvc.Associate(
"queue",
queueId,
new Relationship("queuemembership_association"),
new EntityReferenceCollection() { new EntityReference("systemuser",userid)
});

6. 私有队列移除用户

orgSvc.Disassociate(
"queue",
queueId,
new Relationship("queuemembership_association"),
new EntityReferenceCollection() { new EntityReference("systemuser",userid)
});

Dynamics 365中的常用Associate和Disassociate消息汇总的更多相关文章

  1. Dynamics 365中开发和注册插件介绍

    我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...

  2. 自定义工作流活动报错:您无法登陆系统。原因可能是您的用户记录或您所属的业务部门在Microsoft Dynamics 365中已被禁用。

    本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复265或者20170926可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong.me ...

  3. 将Dynamics 365中的用户及其角色、角色导出到Excel中

    关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复240或者20161204可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong. ...

  4. Dynamics 365中的应用程序介绍

    本人微信和易信公众号:微软动态CRM专家罗勇 ,回复275或者20180630可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong.me ...

  5. Dynamics 365中配置和使用文件夹级别的跟踪(folder-level tracking)

    本人微信和易信公众号:微软动态CRM专家罗勇 ,回复274或者20180630可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong.me ...

  6. Dynamics 365工作流报错:您无法登陆系统。原因可能是您的用户记录或您所属的业务部门在Microsoft Dynamics 365中已被禁用。

    本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复265或者20170926可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong.me ...

  7. Dynamics 365中部分账号使用系统明显缓慢怎么办?先这么干!

    摘要: 本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复263或者20170828可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyon ...

  8. Dynamics 365中审核用户权限变化的一种方法

    摘要: 本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复268或者20180311可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyon ...

  9. Dynamics 365中使用Web API将查找字段的值设置为空值的方法。

    摘要: 本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复270或者20180424可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyon ...

随机推荐

  1. Razor Page Library:开发独立通用RPL(内嵌wwwroot资源文件夹)

    ASP.NET Core知多少系列:总体介绍及目录 Demo路径:GitHub-RPL.Demo 1. Introduction Razor Page Library 是ASP.NET Core 2. ...

  2. Nuget私有服务搭建实战

    最近更新了Nuget私有服务器的版本,之前是2.8.5,现在是2.11.3. Nuget服务器的搭建,这里有篇很详细的文章,跟着弄就好了: https://docs.microsoft.com/en- ...

  3. JQuery实现 图片上传

    用到的文件,我都已经打包好了,自行下载: https://files.cnblogs.com/files/lguow/lib.rar 核心代码如下: <input type="hidd ...

  4. Python程序员为什么一定要掌握Linux?

    不少Python新手经常问到学Python到底需不需要学习Linux? Python不是支持Windows和Linux操作系统吗?能在Windows下开发为什么还要学习Linux? 问这样的问题的朋友 ...

  5. macOS 10.14虚拟机安装教程

    windows10下安装vmware14.0以及macOS 10.14图文详解 工具/原料   windows10 vmware 14.0 macOS 10.14懒人版 mac补丁unlocker工具 ...

  6. [Swift]LeetCode134. 加油站 | Gas Station

    There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You ...

  7. [Swift]LeetCode566. 重塑矩阵 | Reshape the Matrix

    In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new o ...

  8. [Swift]LeetCode632. 最小区间 | Smallest Range

    You have k lists of sorted integers in ascending order. Find the smallest range that includes at lea ...

  9. [Swift]LeetCode740. 删除与获得点数 | Delete and Earn

    Given an array nums of integers, you can perform operations on the array. In each operation, you pic ...

  10. Python—day17时间模块、系统模块、递推遍历、序列化

    一.time'''时间戳(timestamp):time.time()延迟线程的运行:time.sleep(secs)(指定时间戳下的)当前时区时间:time.localtime([secs])(指定 ...