Answered by:
FetchExpression Or QueryExpression

Question
-
Hi,
I need FetchExpression or QueryExpression format for following Query
select
Contact.ContactId,Contact.FullName,OpportunityId
from
Contact full outer join Quote
on
CustomerId = Contact.ContactId and OpportunityId = 'B14594E4-2A3B-E011-A58C-00155D018801'
inner join ListMember
on
EntityId = Contact.ContactId and ListId = '2CCF677D-CE38-E011-BAB2-00155D018801' and OpportunityId is null
RAjeshFriday, March 4, 2011 9:37 AM
Answers
-
Hi Rajesh,
The mentioned stunnware tools are indeed very handy. However, fetchxml (or queryexpression) does not support a FULL outer join.
If you would like to use this for an On Premise report, you could always connect to the CRM database directly and query the data using the supported Filtered Views (FilteredContact, FilteredOpportunity, ...).
In case you need it from code for a custom client application, you can always make two calls to the CRM Service in order retrieve the data you need and then join the results in your code. (e.g. using plain .NET code by looping the arrays or by using LINQ)
Wim
- Proposed as answer by WimCoMicrosoft employee Friday, March 4, 2011 2:02 PM
- Marked as answer by Donna EdwardsMVP Tuesday, March 8, 2011 8:16 PM
Friday, March 4, 2011 2:02 PM -
You could also build a view using advanced find and export the fetchxml from that right through the application (if this is 2011).
Jamie Miley- Marked as answer by Donna EdwardsMVP Tuesday, March 8, 2011 8:16 PM
Friday, March 4, 2011 2:24 PMModerator
All replies
-
Friday, March 4, 2011 12:29 PM
-
Hi Rajesh,
The mentioned stunnware tools are indeed very handy. However, fetchxml (or queryexpression) does not support a FULL outer join.
If you would like to use this for an On Premise report, you could always connect to the CRM database directly and query the data using the supported Filtered Views (FilteredContact, FilteredOpportunity, ...).
In case you need it from code for a custom client application, you can always make two calls to the CRM Service in order retrieve the data you need and then join the results in your code. (e.g. using plain .NET code by looping the arrays or by using LINQ)
Wim
- Proposed as answer by WimCoMicrosoft employee Friday, March 4, 2011 2:02 PM
- Marked as answer by Donna EdwardsMVP Tuesday, March 8, 2011 8:16 PM
Friday, March 4, 2011 2:02 PM -
You could also build a view using advanced find and export the fetchxml from that right through the application (if this is 2011).
Jamie Miley- Marked as answer by Donna EdwardsMVP Tuesday, March 8, 2011 8:16 PM
Friday, March 4, 2011 2:24 PMModerator