Dynamic CRM 查询实体记录 被共享给了 哪个用户 SQL语句

 

--客户表名"new_customer"  

 

SELECT u.FullName AS 被共享人,a.new_name AS 客户名称,sup.SystemUserid AS 共享人ID,POA.ObjectId AS 共享记录ID FROM PrincipalObjectAccess  POA inner  join SystemUserPrincipals sup on POA.PrincipalId = sup.PrincipalId  inner join SystemUserBase u  on sup.SystemUserId=u.SystemUserId inner join dbo.new_customer a  on a.new_customerId=POA.ObjectId WHERE POA.ObjectId IN (SELECT new_customerId FROM dbo.new_customer)

posted @ 2020-03-27 16:18  木子易  Views(284)  Comments(0Edit  收藏  举报