web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Use FetchXml queries with Xrm.WebApi

Savaco Business Applications Profile Picture Savaco Business App... 160

Since Microsoft does not provide an example on how to use fetchXml queries with the Xrm.WebApi calls in JavaScript, we at Thrives feel the moral need to provide you at least one example.
This will be a very basic demonstration, but it will give you an idea on how this works.

Scenario

When opening an existing account record, I want an alert that says hello to all the contacts linked to this account.
I know, I don’t need a fetchXml query to achieve this functionality

Implementation

Explanation

So we need to use the retrieveMultipleRecords method from Xm.WebApi.
The first parameter is the entity name from which you want to retrieve records.
The second parameter is your encoded fetchXml query, preceded by the string ?fetchXml=

In the successCallback you will get the response parameter to work with.
This response object contains an entities attribute, which is an array with the results of your query.
You can loop through this array and process the results in the same way as you are used to when using the retrieveMultipleRecords method without a fetchXml query.

Final result

Het bericht Use FetchXml queries with Xrm.WebApi verscheen eerst op Thrives.


This was originally posted here.

Comments

*This post is locked for comments