locked
Exact Difference between Query expression and fetchXML RRS feed

  • Question

  • Hi,

    Its been very difficult for me even after working for a while in CRM,i am not able to understand what is the exact difference between Query Expression and FetchXML.

    Confusion is here 

    Some says you cant retrieve the related entity column in Query expression but this link(https://msdn.microsoft.com/en-us/library/gg328149(v=crm.5).aspx) proved it wrong.

    Some says you cant put related entity column in filter condition.

    Other differences i know is 

    1)Queryexpression Retrival record limit is 5K and FetchXML have 10K.

    2)Cant use aggregation in Query expression but in FetchXML you can use it.

    Just would like to you what is the exact difference from technical prospective.


    Ayaz

    Saturday, May 9, 2015 4:40 PM

Answers

  • FetchXML

    This is a custom XML-based query language that supports all the   features of QueryExpression plus aggregates and grouping. Fetch queries can   return records for multiple entities. In addition, queries can be serialized   and saved in the database. This is used to save a query as a user-owned saved   view in the UserQuery entity and as an organization-owned saved view in the   SavedQuery entity.
      Use this query language when you need support for aggregates and grouping or   you need to save the query.

    QueryExpression

    A query expression is used to search for records for a single   entity type. Queries are built as an object model. This class supports all   the features in FetchXML except for aggregates and grouping. It also supports   both early and late bound entity programming styles.


    Madhu M.

    • Proposed as answer by Madhu_M Monday, May 11, 2015 1:07 AM
    • Marked as answer by Ayazahmed Wednesday, May 13, 2015 2:09 PM
    Monday, May 11, 2015 1:06 AM