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 :
Customer experience | Sales, Customer Insights,...
Suggested answer

How to retrive 5000+ record using Javascript

(0) ShareShare
ReportReport
Posted on by 94

I want to retrive 5000+ record using javascript.

i have 20000+ product in my price list so i want to retrive all using fetchxml 

XrmServiceToolkit.Soap.Fetch(fetchXml);

Please help me.

Thanks in Advance..!!!!

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to retrive 5000+ record using Javascript

    Hello,

    If you want to use XrmServiceToolkit.Soap.Fetch you will have to use paging in the way similar to following - docs.microsoft.com/.../page-large-result-sets-with-queryexpression

  • Maulik Lakhani Profile Picture
    94 on at
    RE: How to retrive 5000+ record using Javascript

    But how can i implement using javascript?

    There are steps for c#...

    can you please suggest me using example?

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to retrive 5000+ record using Javascript

    Sure, I provided you an example how to do it using C#. Now it's your turn to build JavaScript that will do it.

    Good luck.

  • Suggested answer
    Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at
    RE: How to retrive 5000+ record using Javascript

    Hello Maulik,

    Please see the below link:

    community.dynamics.com/.../odata-web-api-crm-online-how-to-query-more-than-5000-records

  • RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: How to retrive 5000+ record using Javascript

    Hi,

    Would suggest to think about your implementation again, retrieving 20K+ records using javascript may cause some other problems. Why do you want all these products? Are you trying to populate some field/ table etc? If yes, think about the user who needs to select record from these 20K+ records.

  • Suggested answer
    Maulik Lakhani Profile Picture
    94 on at
    RE: How to retrive 5000+ record using Javascript

    i got the answer.

    var fetchXmlProductInventory = "  <entity name='productpricelevel'>" +

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

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

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

                  "    <filter type='and'>" +

                  "      <condition attribute='pricelevelid' operator='eq' uiname='" + priceListName + "' uitype='pricelevel' value='" + priceListID + "' />" +

                  "    </filter>" +

                  "    <link-entity name='product' from='productid' to='productid' link-type='inner' alias='ab'>" +

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

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

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

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

                  "      <filter type='and'>" +

                  "        <condition attribute='als_tempproduct' operator='eq' value='0' />" +

                  "<condition attribute='statecode' operator='eq' value='0' />"

              "      </filter>" +

              "    </link-entity>" +

              "  </entity>";

              var pageNumber = 1;

              var pageCookies = "";

              var fetchXmlProductInventory = ["<fetch mapping='logical' page='" + pageNumber + "' " + pageCookies + ">", fetchXmlProductInventory, "</fetch>"].join("");

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 125

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 121 Super User 2025 Season 2

#3
Erin Lubben Profile Picture

Erin Lubben 73

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans