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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Facing issue with Xrm.WebApi.retrieveMultipleRecords request

(0) ShareShare
ReportReport
Posted on by 12

Hi Team,

We are working to retrieve records using Xrm.Web.retrieveMultipleRecords request with the help of fetchxml but the result doesn't return nextLink value to get the set of records of the next page. We are facing this issues with only the fetchxml, as its working properly with Odata Query. Here’s the code:

 

function retrieveAllRecords() {

    var accountFetch = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +

  "<entity name='account'>" +

    "<attribute name='name' />" +

    "<attribute name='primarycontactid' />" +

    "<attribute name='telephone1' />" +

    "<attribute name='accountid' />" +

    "<order attribute='name' descending='false' />" +

  "</entity>" +

"</fetch>";

 

    accountFetch = "?fetchXml=" + encodeURIComponent(accountFetch);

 

    Xrm.WebApi.retrieveMultipleRecords("account", accountFetch).then(

    function success(result) {

        if (result.nextLink != undefined) {

            Xrm.Utility.alertDialog("page found");

        } else {

            Xrm.Utility.alertDialog("page not found");

        }

    },

    function (error) {

        Xrm.Utility.alertDialog(error.message);

    });

}

 

Could anyone please let us know if there any issue with fetchxml or it a limitation of WebApi.

Thanks,

Vikas

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Saad Kabarousse Profile Picture
    734 on at
    RE: Facing issue with Xrm.WebApi.retrieveMultipleRecords request

    Hello,

    You can use CRM RestBuilder Solution, it will build you the request and you can also it gives a screen that allows you to test your request.

    github.com/.../CRMRESTBuilder

  • erhan.keskin Profile Picture
    2,253 on at
    RE: Facing issue with Xrm.WebApi.retrieveMultipleRecords request

    Hi,

    If you use the query like "?$select=name" and give maxPageSize then it works.

    But for a FetchXml, it does not work.

    Let us know if you have it worked.

    Regards,

  • Community Member Profile Picture
    on at
    RE: Facing issue with Xrm.WebApi.retrieveMultipleRecords request

    Yes, I can use the "?select=...." version to get it works.

    But all I have is the fetchxml, can anyone suggest how can I get it working?

    thanks

    Ken

  • PSauve_mdfcommerce Profile Picture
    22 on at
    Facing issue with Xrm.WebApi.retrieveMultipleRecords request
    Try to add "?fetchXml=" in your first row, like that
     "?fetchXml=<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
UllrSki Profile Picture

UllrSki 2

#1
Community Member Profile Picture

Community Member 2

#3
SC-08081331-0 Profile Picture

SC-08081331-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans