Maximum of 5000 responses from a FetchXml

July 5, 2011 by · 1 Comment 

Recently I was working with the Periodic Workflow Tool. I tried to run some workflows on an imported record set (about 26.000 records). This all seemed to work fine, but later we discovered that the workflows didn't run on all the records…
Soon I discovered that only the first 5000 records in the view were processed, after that it just stopped.

I checked the source code of the Periodic Workflow Tool, but I couldn't find a limit of 5000 anywhere and had to look further.
I came across this Microsoft article. In this article is explained that FetchXml works with paging and that it the maximum number of results can be adjusted.

My winning combination:

  1. Click Start, click Run, type regedit in the Open box, and then click OK.
  2. Locate and then select the following registry subkey:
    HKEY_LOCAL_MACHINE\Software\Microsoft\MSCRM
  3. On the Edit menu, point to New, and then click DWORD Value.
  4. Type TurnOffFetchThrottling, and then press ENTER.
  5. Right-click TurnOffFetchThrottling, and then click Modify.
  6. Type a number other than 0 in the Value data box, and then click OK.Note Step 6 lets you retrieve the number of records specified in the Count attribute of your fetch statement.
  7. On the File menu, click Exit.