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 :
Microsoft Dynamics CRM (Archived)

FetchXML Sub queries

(0) ShareShare
ReportReport
Posted on by

Hi,

I dont write reports, and we have an on premise installation at the moment that one of the people who does write reports is using some tool to publish reports he made in SQL.

These reports have sub queries and some login applied to some fields.

As a company we are planning on moving to crm online, obviously this means reports will have to be re-written in fetchxml so my question is - is it possible to do something like sub queries in fetchxml as i understand one of the limitation is that it cant handle them?

*This post is locked for comments

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    There is no way doing subqueries in FetchXml reports so you will have to prepare data on CRM side before building of a report and use prepared data without subqueries.

  • Community Member Profile Picture
    on at

    how do you mean prepare data?

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    You can convert your sql query to fetch xml online. please refer the below link :

    http://www.sql2fetchxml.com/

  • Community Member Profile Picture
    on at

    Hi,

    You should consider re-engineering your current SSRS to include input parameters:

    http://blogs.msdn.com/b/crm/archive/2011/03/18/parameterizing-fetch-based-reports.aspx

    FetchXml offers all basic SQL functionality, so 99% of scenarios should be achievable, and once you have your data set ready, SSRS functions allows you to farther filter/manipulate data.

    Thanks,

    Piotr

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    For example you have report with following SQL query:

    Select

    a.Name

    ,(Select Count(*) From FilteredContact c where c.parentcustomerid = a.accountid) ContactsCount

    From FilteredAccount a

    You can't convert it directly using FetchXml statement. So preparation in this case is creation of int field in account entity and population of it based on number of child contacts (this can be done through rollup field or simple field and plugin that handle operation with child contacts).

  • suresh maurya Profile Picture
    630 on at

    You can test FetchXML online http://msxrmtools.com

  • suresh maurya Profile Picture
    630 on at

    For testing of FetchXML, you can test here online http://msxrmtools.com

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans