3 Jul’19

D365 Customer Service

Tips to Solve your Infinite Loop Issue

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.

Description:

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

Conclusion

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

  • How to Run Reports when report processing takes long to cause Session Time-out

    12 July’ 2019

    Introduction: I’ve observed that when NAV is used for a very long time, the report which needs heavy processing ta...

    Read more
  • First Canvas Power App: Learn Few Easy and Important Commands

    11 July’ 2019

    As my thoughts build to initiate writing this blog, similar was the feeling when I first thought about exploring Power A...

    Read more
  • Tips to Solve your Infinite Loop Issue

    3 July’ 2019

    While using fetch xml to retrieve records more than 5000 records and if you have multiple entities involve in it. There ...

    Read more
  • Deploy Dynamics 365 Operations Environment using Lifecycle Services – Part 2

    2 July’ 2019

    In this article, we will take look at the post configuration setting for Finance and Operations environment.You can lo...

    Read more
  • Shift/Statement posting error in Microsoft Dynamics 365 For Retail

    1 July’ 2019

    In this blog I am going to  demonstrate how to deal with errors generated during statement posting. At times while you ...

    Read more
  • We respect your privacy.
  • This field is for validation purposes and should be left unchanged.