DEV Community

Mariela Dimitrova for Software AG Tech Community

Posted on • Originally published at tech.forums.softwareag.com on

Microsoft Dynamics CRM 365 Query operations with $expand option

Summary:

This article describes the use case for Query operations of Microsoft Dynamics CRM 365 Connector with the $expand function in the on-premise

Prerequisites:

• The user needs to have a working account for Microsoft Azure Active Directory and a Microsoft Dynamics CRM 365 license to access the API

• License for the Integration server 10.3 or above

Contents:

We will analyze the various options of querying the business objects, Example: $expand & filters in the Microsoft Dynamics CRM 365 using Query Operation service in the Connector. More information can be found at Basic Tutorial · OData - the Best Way to REST

Steps:

  1. User needs to start the Integrations Server and open Designer along with the latest Microsoft Dynamics CRM 365 package installed, also the Connection should be established
  2. Once the Server gets started, the user needs to create the CCS (cloud connector service) for the query operation available in the Connector. In this example, we will query the Accounts business object
  3. To create the CCS , choose any folder and Right-click to choose New → Cloud Connector Service Option image
  4. Enter any name for the CCS as per user requirements, Example: queryAccounts image
  5. Now choose the Microsoft Dynamics 365 CRM option from the available Connectors list and click Next image
  6. Choose the Connection alias from the available Connection Pool list and click Finish image
  7. Now click Recourse Name option as mentioned in the below screenshot image
  8. Then choose the Query resource from the list of resources and click Next image
  9. All the business objects will appear in the next window, here we will choose the accounts business object to query the accounts. Choose accounts and click Next image
  10. In the next screen, the user will find all the fields list with respect to the accounts business object. Here user can choose the fields required to be seen in the response. Example: Choose name , account id & $expand and then click Finish & Save Choose accountid : image Choose name : image Choose $expand : Related entities to be included inline in the response. More information about the $expand can be found at Using $select, $expand, and $value in ASP.NET Web API 2 OData - ASP.NET 4.x | Microsoft Docs image
  11. Now we will run the queryAccounts CCS image
  12. The next screen shows all the request parameters. First, we will run this service without specifying any parameters, click OK image
  13. This service executes successfully, the user will get all the account details present in the tenant with the fields selected in the above step 10 image
  14. Now we will query based on the request parameters. Rerun this service again, this time we will fetch the information about the particular accountid (not all the accounts). Example: Specify the filter option filter: accountid eq 4ab4a12a-1f3e-e911-a960-000d3a1f716c [image Results: image

Read full topic

Top comments (0)