How to Relink Multiple InfoPath Forms in SharePoint

After our farm migration, we realized that our new domain name and InfoPath didn’t get along.  Our old domain name was a simple http://intranet and all the InfoPath Forms were linked to that name.  After being asked to re-link several thousand forms (clicking one at a time) I started looking around the web for a solution.
Here is what I found:
1)    Open the library. Click Settings –> Form Library Settings –> Relink documents to this Library. Now copy the URL in your address bar.
2)    Open this page in SharePoint Designer. File –> Open –> paste the URL in the File name: field and click Open.
3)    If you don’t see the split screen layout, complete the following steps. Click on View –> Page –> Split
4)    Locate the <FORM> tag within the HTML section of the page and place the following code before the </FORM> tag.
<script type=”text/javascript” language=”javascript”>
function CheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = true ;
}
</script>
<input type=”button” value=”Check All” onclick=”CheckAll(document.forms.aspnetForm.chkRepair)” >
5) Save, Refresh the page, you should now see a Check All button in the bottom left corner of the page.

Here is what my HTML looks like:

<FORM id=”SubmitRepairDocsForm” method=”POST” action=””>
<INPUT id=”SubmitRepairRedirectList” type=”hidden” name=”SubmitRepairRedirectList” />
<INPUT id=”SubmitRepairRedirectFolder” type=”hidden” name=”SubmitRepairRedirectFolder” />
<INPUT id=”SubmitRepairDocs” type=”hidden” name=”SubmitRepairDocs” />
<SharePoint:FormDigest runat=server ForceRender=”true”/>
<script type=”text/javascript” language=”javascript”>
function CheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = true ;
}
</script>
<input type=”button” value=”Check All” onclick=”CheckAll(document.aspnetForm.chkRepair)” >

</FORM>

Edit…

If you want to speed up this process, you can also edit the RowLimit property.
Search in the code for RowLimit, by default it’s set to 100, change it to 500.

RowLimit Paged=”TRUE”&gt;500&lt;

6 thoughts on “How to Relink Multiple InfoPath Forms in SharePoint

  1. Needed to change the CheckAll parameter to “document.forms.aspnetForm.chkRepair” to get it to work. Thanks for the trick!

  2. Thanks! And as posted elsewhere you may want to set rowlimit to 500. I had over 2600 to update and this was a life saver!

Leave a Reply

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