locked
Reterive multiple type of entites in single fetchxml query. RRS feed

  • Question

  • Hi Experts,

    I want to get record to different type entities in single fetchxml query, without any innerjoin or other join.

    Entities are not in relationship to each other.

    Ex.

    All record of account and contact in single fetch.


    Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    Wednesday, March 19, 2014 11:05 AM

All replies

  • Hi Santosh,

    I don't think that's possible. FetchXML allows you to have only one primary entity against which you can add several linked entities and fetch the related data (possibly from any entity). But in your case, where you do not want to use joins, it's not possible to fetch account and contact data in a single fetch query.


    Admin QuikView Solution for CRM 2013

    Wednesday, March 19, 2014 11:46 AM
  • Depending on why you want the records in this format (single result), you could just develop a fetchxml 'aggregator' method that lets you append the results of fetchxml queries together, similar to what a 'fetchall' method would do with paging. Yes you're still making two separate calls, but if you really have a need for the results to be combined, you could do it.

    http://connect.greenbeacon.com/2011/12/fetchall-for-microsoft-dynamics-crm-2011-%E2%80%93-handling-large-fetchxml-resultsets/

    Wednesday, March 19, 2014 3:43 PM
  • Thanks for the reply.

    I just want to know it is possible via some particular way or not?


    Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    Thursday, March 20, 2014 3:19 AM