web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Dynamics Chronicles / Aggregate using XrmToolBox ...

Aggregate using XrmToolBox FetchXml Builder

Dynamics Chronicles Profile Picture Dynamics Chronicles 958
Aggregate using XrmToolBox FetchXml Builder Pham Ba Son Wed, 12/01/2021 - 05:28
Body

Aggregate using XrmToolBox FetchXml Builder

Since the introduction of Dataverse, many utilities has been added to us developers' arsenal. One of them is the ability to use aggregate function with FetchXml. This eliminates the need to invoke LINQ operation or manual iteration in certain situations.

FetchXml now supports these following operations:

  • Sum
  • Average
  • Min
  • Max
  • Count

On top of those, Group By and Multiple Aggregation is also available (works on datetime field as well). This makes query using FetchXml becomes more versatile.

To ensure query performance, queries that return aggregate values are limited to 50000 records. Working with a sizable tables will need to be well designed.

Aggregate query in FetchXml Builder

FetchXml Builder is a very handy tool offered by XrmToolBox used by many developer to build fetchXml querry. Select aggregate option for the root level of the querry enables aggregate on entity's attribute.

Aggregate using XrmToolBox FetchXml Builder

Settings options on attribute level

Aggregate using XrmToolBox FetchXml Builder

Possible attribute aggregation

Aggregate using XrmToolBox FetchXml Builder

Aggregate using XrmToolBox FetchXml Builder


This was originally posted here.

Comments

*This post is locked for comments