Sunday, 17 April 2016

fiscal-period - FetchXML Query

The following example shows a FetchXML aggregation expression that sums the total amount of orders fulfilled and groups the result by fiscal semester and fiscal year.
  1. <fetch aggregate="true">
  2. <entity name="order">
  3. <attribute name="totalamount" aggregate="sum" alias="total"/>
  4. <attribute name="datefulfilled" groupby="true" dategrouping="fiscal-period"/>
  5. </entity>
  6. </fetch>
Explanation
To create group by with linked entity FetchXML:
  • Create an aggregate query
  • Add link-entity node for entity which contains group by attribute (systemuser entity in this case.)
  • In link-entity node add required attribute containing groupby keyword with value set to true.
- See more at: http://msxrmtools.com/fetchxml/reference

No comments:

Post a Comment