Building and Testing FetchXML Queries Using the CRM Native Query Block in TIBCO Cloud Integration - Connect

Building and Testing FetchXML Queries Using the CRM Native Query Block in TIBCO Cloud Integration - Connect

book

Article ID: KB0073063

calendar_today

Updated On:

Products Versions
TIBCO Cloud Integration - Connect ( Scribe ) N/A

Description

Product: TIBCO Cloud Integration - Connect (Scribe) / Scribe Online 

Issue/Question: What tools can I use to build and Test FetchXML Queries? 

FetchXML is a proprietary query language that is used in Microsoft Dynamics 365 (online & on-premises). It’s based on a schema that describes the capabilities of the language. The FetchXML language supports similar query capabilities as query expressions. In addition, it’s used as a serialized form of query, used to save a query as a user-owned saved view in the userquery entity and as an organization-owned saved view in the savedquery entity.

The Connector for Microsoft Dynamics 365 / CRM supports using the FetchXML query language in a Native Query Block to create customized queries for Microsoft Dynamics 365 / CRM entity records and associated child records. The query can be as simple or complex as you need it to be; however, it should return a single result set.

When using a Native Query Block with FetchXML or a standard Query Block to return related entities, only the first 1000 child entities can be returned for a single parent record.

It is important to note that after entering the FetchXML query, you must select Test to validate the query. Invalid XML is not accepted by the Connector.

Tools For Building FetchXML Queries: 
There are a few tools that could be used when building FetchXML queries: 
  • Using the CRM Advanced Find Button to construct the query and clicking on the Download Fetch XML button
kA30e000000fxmFCAQ_en_US_1_0
  • FetchXML Builder: This is used for constructing FetchXML in ways that Advanced Find cannot, which include; aggregates, outer joins,"has no"-queries and attributes from multi-level linked entities. 
  • SQL2FetchXMLThis website allows users who are familiar with SQL but not FetchXML to generate the proper FetchXML. For example, a user can enter statements like 'SELECT contactId, FirstName, LastName from Contact' and the FetchXML would be generated as: 
  <fetch mapping="logical" version="1.0">
  <entity name="contact">
    <attribute name="contactid" />
    <attribute name="firstname" />
    <attribute name="lastname" />
  </entity>
</fetch>

User-added image

Tools for Testing FetchXML Queries

- Request
User-added image

- Response
User-added image

 

- Using the same FetchXML query in TIBCO Cloud Integration - Connect (Scribe) produces the same resultset. 

User-added image

- Data Preview 
User-added image

Issue/Introduction

Tools for building and testing FetchXML Queries with Microsoft Dynamics 365 / CRM / CE using Integration - Connect.

Additional Information

TIBCO Scribe® Online Connector For Microsoft Dynamics 365 / CRM
https://help.scribesoft.com/scribe/en/sol/conn/crm.htm

XrmToolBox
https://www.xrmtoolbox.com/

SQL2FetchXML
http://sql2fetchxml.com/