locked
FetchExpression Or QueryExpression RRS feed

  • 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


    RAjesh
    Friday, 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 

    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
    Friday, March 4, 2011 2:24 PM
    Moderator

All replies

  • hi,

    try using sw tool for fetch xml wizard

    http://www.stunnware.com/crm2/topic.aspx?id=FindingData6

    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 

    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
    Friday, March 4, 2011 2:24 PM
    Moderator