导航

MSCRM 共享查询

Posted on 2012-06-08 11:30  yiyishuitian  阅读(185)  评论(0)    收藏  举报

1。如何知道本实体Instance共享给了哪些人。

select u.FullName,a.name,sup.SystemUserId,POA.ObjectId 
from PrincipalObjectAccess POA inner join SystemUserPrincipals sup on POA.PrincipalId = sup.PrincipalId
                    inner join SystemUserBase u on sup.SystemUserId=u.SystemUserId
                    inner join Account a on a.AccountId=POA.ObjectId
where POA.objecttypecode=112       AND ((POA.AccessRightsMask | POA.InheritedAccessRightsMask) & 1)=1
      and POA.ObjectId='DA063BA9-FFD5-DB11-833C-001708576698'

  

Objecttypecode是每个实体的编号,非常重要,可以从SDK中查得。

 

转自 http://blog.csdn.net/enhydraboy/archive/2007/07/03/1677123.aspx

 

备注:此代码可在 CRM系统 filteredaccount 视图 中查看源代码,得到.