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 to text file that has hierarchy

(0) ShareShare
ReportReport
Posted on by

Ok. What I am trying to do is pull data from entity based on hierarchy. One section has base info, then there is the header info, then the detail info under that for each header. First of all, is FetchXML my best option, and secondly can I just write it like a standard XML file with hierarchy?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    The best choice depends on whether you are using CRM online or OnPRem.

    For OnPrem, SQL is the way to go.

    For Online, fetchxml is the option you have but its not simple xml. It has limitation on number of link entities which is 10.

    If you can write more about business requirement then I can probably provide more input.

    Thanks,

    Prateek

  • Community Member Profile Picture
    on at

    This is CRM Online. Basically the script was originally written in CF coming from an ERP to now what we want to do is pull down the same info from CRM and push to a csv file. And basically what we are trying to get is vendor info and costs so for example:

    <b>Line1 has the base information

    <v> Line2 would have vendor information

    <d>Line3 would have details of vendor sale

    <d>Line4 might also

    <v>Then you may have a different vendor line

    <d> and detail info about the sale to that vendor

    etc

    Does that make sense? I know with fetchxml, I can grab the info that I need, but pulling it in the usual way, not sure, unless there is some way to put in hierarchy so it comes out like below:

    Line1 has the base information

    Line2 would have vendor information

    Line3 would have details of vendor sale

    Line4 might also

    Then you may have a different vendor line

    and detail info about the sale to that vendor

    Any advice? Or about I going about this the wrong way or thinking too hard?

  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    Hi,

    So fetchxml output is a fixed xml format - records node with data.

    We cant change the output format.

    I believe Vendor sale and detail will exist in crm as link entities so the format you will receive by fetchxml will just a xml node with data - one node for each detail and its parent vendor.

    Now how to achieve this in a user speicified format? You need to write code for that - Basically in C# you just need to parse this xml and put it in new format. It will be dev effort.

    Also if you use webAPI you can get output in json but then again that need ot be parsed to xml of your desired format.

    Thanks,

    Prateek

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