我需要获取分配给系统用户的所有帐户记录。这个linq查询不起作用。我究竟做错了什么? `
var accts = from a in xrm.AccountSet
where a.OwningUser == new CrmEntityReference(SystemUser.EntityLogicalName, new Guid("<systemUserGuid>"))
select a;
答案 0 :(得分:1)
尝试
ar accts = from a in xrm.AccountSet
where a.OwnerId.Id == new Guid("<systemUserGuid>")
select a;