Questions tagged [fetchxml]

A proprietary query language used in Dynamics CRM. It can be used in Javascript, SSRS, and web services.

For more information please refer to Docs.

400 questions
9
votes
2 answers

Is it possible to limit the amount of results returned in a response when using a QueryExpression in CRM 4

Basically I have a QueryExpression that returns over 3000 results. I only need to use between 50 and 200 of these. If I was using normal sql I could use SELECT TOP 200..... Is there a way to do this in CRM using the QueryExpression or FetchXML?
Neil
  • 2,659
  • 7
  • 35
  • 57
9
votes
1 answer

Aggregate Count of linked entity in fetch XML won't return 0

Problem I have a Fetch XML query that has an aggregate count on a linked entity that isn't behaving as expected. Basically I'm returning a list of courses, and getting a count of how many contacts are currently registered for the course, but even…
Daryl
  • 18,592
  • 9
  • 78
  • 145
8
votes
4 answers

How to Execute FetchXML in CRM 2011 using a CRM 2011 webservice and JavaScript?

I want to execute FetchXML queries in a CRM 2011 environment using the CRM 2011 SOAP web services and JavaScript. I have found a number of articles like this one showing how to use the 4.0 web service that is still available in the 2011 environment,…
Paul
  • 1,590
  • 5
  • 20
  • 41
8
votes
1 answer

Using Linked-Entity in addCustomFilter

At this moment I know how to use the addCustomFilter in combination with addPreSearch (and the remove variants). All this works perfectly when passing a filterXml like:
user3687899
  • 81
  • 1
  • 5
7
votes
1 answer

Are composite joins possible using FetchXml in Microsoft Dynamics CRM 4.0?

I am using FetchXml to query CRM 4.0. We have a special case that will require a composite join between CRM entites. The FetchXml schema indicates that multiple link-entity elements are allowed, and it also indicates that multiple filter/condition…
7
votes
5 answers

How do you handle the fetchxml result data?

I have avoided working with fetchxml as I have been unsure the best way to handle the result data after calling crmService.Fetch(fetchXml). In a couple of situations, I have used an XDocument with LINQ to retrieve the data from this data structure,…
Luke Baulch
  • 3,626
  • 6
  • 36
  • 44
6
votes
4 answers

QueryExpression vs. FetchXml CRM2011

We found out that Linq for CRM 2011 is horribly broken - it seems to have gotten in without any QA performed on it. An indicator as how badly broken the provider is a query like .Where(x => x== "b") works but this .Where(x => "b" == x) might not…
Alwyn
  • 8,079
  • 12
  • 59
  • 107
6
votes
3 answers

How to Make a Condition Optional in FetchXML

I have some SQL reports that has very slow performance, so we converted all of them into FetchXML, but all the SQL reports has all the conditions optional, something like this: SELECT ... FROM ... WHERE (@operator = 'All' OR Operator …
5
votes
2 answers

How to query Dynamics CRM Web API using custom FetchXml involving Number value filter?

I am trying to execute fetch XML using WEB API /api/data/v8.x. All is fine except when I have query involving "where a attribute contains number value". For example, the following fetchXML to find account with phone number contains '03':
5
votes
2 answers

How to cast an Xrm.EntityCollection to a List?

Overview: I'm coding a FetchXML query to return users with disabled mailboxes in a Dynamics 2015 online CRM instance. Now I've come to a stage where the query results need to be bound to a ListView. (The project is using the Dynamics SDK 2015…
Brian Var
  • 6,029
  • 25
  • 114
  • 212
5
votes
1 answer

Left join in FetchXml?

How do i do a left join using FetchXml? Consider a simple SQL query like the following: select person.name, address.city from person left join address on person.addressid = address.addressid How would something simple like this be done using…
Luke Baulch
  • 3,626
  • 6
  • 36
  • 44
5
votes
3 answers

FetchXML to Get 2nd Relation Entity

Is it possible to display fields from nested link-entities in a view? I have 3 entities: statistics, account, and address. Statistics has a lookup to Account and account has a lookup to Address. I want fields from all these entities in the…
Bvrce
  • 2,170
  • 2
  • 27
  • 45
4
votes
1 answer

How to get audit record details using FetchXML

Using this query im able to retrieve audit records in Microsoft Dynamics CRM online But this lacks the info about what happened in the operation, more…
BobbyTables
  • 4,481
  • 1
  • 31
  • 39
4
votes
1 answer

Unable to get "Microsoft Dynamics CRM Fetch" in Data Source options for SSRS reports project for CRM 2015

I have a problem very similar to this post I have installed "Microsoft Dynamics CRM Report Authoring Extension" for Dynamics CRM 2015. Installed BIDS for Sql Server 2012 and working with VS 2013 Community Edition. Windows Live sign-in assistant is…
4
votes
1 answer

FetchXml query generates a 'Generic SQL Error' but works if I switch the linked entities around?

I'm attempting to query the product catalog of a "vanilla" CRM 2015, my final aim is to retrieve the active products by price list and substring of name, at the moment I'm hard-coding my data as follows: PriceLevel: hardcoded GUID Name: hardcoded…
Alex
  • 23,004
  • 4
  • 39
  • 73
1
2 3
26 27