I'm using Microsoft Dynamics CRM 2011 and ADX Studios. On one of the pages I'm trying to make a widget that will display the user's number of current leads. I want to do a LINQ query that selects the count of lead where the owner of the lead entity in the CRM database is equal to the current user. I'm new to LINQ, so I'm still trying to get a grasp on the semantics of the queries. Below I have my code so far which pulls in all leads. I'm not quite sure how to work in the "where" clause that checks to see if the owner id equals that of the current user.
count = context.LeadSet.ToList().Count();
See this answer:
Linq to CRM doesn't support any aggregate expressions, so it would be better from a performance standpoint to use Fetch XML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With