3 Jul’19

D365 Customer ServiceTips 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

  • POS Receipts printing, Device connectivity issues in Microsoft D365 For Retail

    16 September’ 2019

    Activating/installing POS on a new system is a straight forward process. However what I have noticed on several occasion...

    Read more
  • Using For Each Loop in SSIS for Invoice Integration from SQL Server to Microsoft D365 Sales Using KingswaySoft Connector for CRM: Part 1

    12 September’ 2019

    Part 1/4: Using FOR EACH Loop with KingswaySoft Connector for CRM Invoice Integration. Introduction: The SSIS ForEach Lo...

    Read more
  • Using For Each Loop in SSIS for Invoice Integration from SQL Server to Microsoft D365 Sales Using KingswaySoft Connector for CRM: Part 2

    12 September’ 2019

    Phase 2/4: SSIS Integration Map for Invoice Header from SQL Server to Microsoft CRM: The Map after Completion will look ...

    Read more
  • Using For Each Loop in SSIS for Invoice Integration from SQL Server to Microsoft D365 Sales Using KingswaySoft Connector for CRM: Part 3

    12 September’ 2019

    Part 3/4 SSIS Integration Map for Invoice Details from SQL Server to Microsoft CRM Step 1: Add a DFT to Integrate the In...

    Read more
  • Using For Each Loop in SSIS for Invoice Integration from SQL Server to Microsoft D365 Sales Using KingswaySoft Connector for CRM: Part 4

    12 September’ 2019

    Part 4/4 Delete Logic for Invoice in case of Incomplete Integration of Invoice details Logic Introduction: To handle the...

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