zoukankan      html  css  js  c++  java
  • crm查询记录共享给了哪些人

    有时候,我们须要查询一个记录。共享给了哪些人?怎么做?

    第一种做法:是sql的方式

    select * from PrincipalObjectAccess where objectid = '522626B1-D10C-E411-80FF-00155D002F02'
    select u.FullName,sup.SystemUserId,POA.ObjectId,AccessRightsMask
    from PrincipalObjectAccess POA inner
    join SystemUserPrincipals sup on POA.PrincipalId = sup.PrincipalId
    inner join SystemUserBase u
    on sup.SystemUserId=u.SystemUserId
    where
    ((POA.AccessRightsMask | POA.InheritedAccessRightsMask) & 1)=1
    and POA.ObjectId='522626B1-D10C-E411-80FF-00155D002F02'

    另外一种是运行request的方式:

    EntityReference target = new EntityReference();
    target.Id = new Guid("522626B1-D10C-E411-80FF-00155D002F02");
    target.LogicalName = "new_pr_detail_gather";

                    
    RetrieveSharedPrincipalsAndAccessRequest shareRequest = new RetrieveSharedPrincipalsAndAccessRequest();
    shareRequest.Target = target;
    RetrieveSharedPrincipalsAndAccessResponse shareResponse =
          (RetrieveSharedPrincipalsAndAccessResponse)service.Execute(shareRequest);
    if(shareResponse.PrincipalAccesses != null) 
    {
            foreach(PrincipalAccess pa in shareResponse.PrincipalAccesses)
            {
                     System.Console.WriteLine("AccessMask: " + pa.AccessMask);
                     System.Console.WriteLine("Id: " + pa.Principal.Id + ",LogicalName: " + pa.Principal.LogicalName); 
            }
    }


                    

     

  • 相关阅读:
    SSD论文优秀句子
    A Case Study -- Performance Evaluation of a DRAM-Based Solid State Disk
    A Case for Flash Memory SSD in Enterprise Database Applications
    Understanding Manycore Scalability of File Systems
    slabs.c
    背包九讲
    redis async client 与自有框架集成
    同步git修改文件到远端服务器脚本
    服务发现:Zookeeper vs etcd vs Consul
    Linux 常用工具贴
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/5199283.html
Copyright © 2011-2022 走看看