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

Announcements

No record found.

News and Announcements icon
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

  • Suggested answer
    Saad Kabarousse Profile Picture
    734 on at

    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

    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

    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
    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans