3 Jul’19

D365 Customer ServicePowerful Tips to Solve your Infinite Loop Issue

Dynamics 365 for Customer Service is the right ERP software to use if you desire to see the customer service improvement in your company. When businesses provide excellent customer support, clients not only have the best experiences, but they also stay loyal to a business. Of course, there are so many ERP solutions out there in the market.

Dynamics 365 solutions are, however, the best in the world as many companies tried and tested this product and love the way it helps them to become a lot more organized. Since Microsoft owns this product, they do a lot of research to enhance this particular product. One problem people do not know how to fix is the infinite loop issue. Here are some fantastic tips to help you to surpass the problem.

While using fetch xml to retrieve records more than 5000 records and if you have multiple entities involve in it. There are chances that you will get into an infinite loop even if you have less than 5000 records.


We have noticed that after 9.0 if you are using the old method to retrieve more that 5000 records using the fetch xml in the script it is possible that you will get the into infilter loop. This happens due to the internal multiplication of table which gives fist and last records id same in fetch XML.

You need to make sure that include the header as shown in the below screen

Need to make sure that you have below check condition before calling the fetch next record collection

if (data[“@Microsoft.Dynamics.CRM.fetchxmlpagingcookie”] != null && data[“@Microsoft.Dynamics.CRM.morerecords”] != null && data[“@Microsoft.Dynamics.CRM.morerecords”]==true) {

It has more than 1 record true only than call the next request


Hope this helps you to solve your infinite loop issue.

Written by

Subhash Mahato

Technical Consultant

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Quick Tips For Formatting SSRS Reports

    19 November’ 2019

    The tips for formating SSRS reports have been covered here. The Default margin settings have been given as to avoid the ...

    Read more
  • Disable Recently Used Items in Lookup of D365 CRM

    19 November’ 2019

    Introduction: This blog details steps on how to disable most recently used items in Lookup of D365 CRM. Scenario: Enabli...

    Read more
  • Why you should Migrate from Excel to Power BI for Reporting

    19 November’ 2019

    Microsoft Excel has traditionally been the go-to reporting tool for businesses, but Power BI offers powerful analytics a...

    Read more
  • How to resolve error when attaching a database in SQL Server

    15 November’ 2019

    Introduction: One of the common Errors while attaching a .mdf file for restoring Data is as follows: An error occurred w...

    Read more
  • How to use “Level up” for Dynamics 365 CRM?

    15 November’ 2019

    This chrome extension allows to easily find the logical names of entities. It also allows Dynamics CRM users to perform ...

    Read more