GroupBy, Sum and EntityCollection in CRM – Nishant Rana’s Weblog

Nishant RanaDyn365CE8 years ago46 Views

Just sharing a sample code that could be used for group by and sum operation on EntityCollection.

Suppose below is the output that we want

We can use the below code for that.



// select categoryid, final forecast, final awards from SubCategory Entity
// category id is lookup in SubCategory Entity

EntityCollection result = orgProxy.RetrieveMultiple(new FetchExpression(fetch));

var details = from r in result.Entities.AsEnumerable()
group r by new
{
groupByCategoryID =...

Full Article

GroupBy, Sum and EntityCollection in CRM – Nishant Rana’s Weblog

Blog Syndicated with Nishant Rana’s Permission

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Follow
Sign In/Sign Up Sidebar Search
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...