CRM 2013 - linq查询以获取特定所有者的帐户

时间:2014-10-07 02:38:47

标签: linq dynamics-crm

我需要获取分配给系统用户的所有帐户记录。这个linq查询不起作用。我究竟做错了什么?     `

var accts = from a in xrm.AccountSet
   where a.OwningUser == new CrmEntityReference(SystemUser.EntityLogicalName,  new Guid("<systemUserGuid>"))
   select a;

1 个答案:

答案 0 :(得分:1)

尝试

ar accts = from a in xrm.AccountSet
   where a.OwnerId.Id == new Guid("<systemUserGuid>")
   select a;