Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

How to retrive 5000+ record using Javascript

Posted on by 92

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

  • Suggested answer
    Maulik Lakhani Profile Picture
    Maulik Lakhani 92 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("");

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 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
    Naveen Ganeshe Profile Picture
    Naveen Ganeshe 3,393 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

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 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.

  • Maulik Lakhani Profile Picture
    Maulik Lakhani 92 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
    a33ik 84,323 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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans