Infinite_Loop_Fetchxml - CloudFronts

Infinite_Loop_Fetchxml

Introduction

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.


Share Story :

Secured By miniOrange