Getting all those Infopath forms relinked in SharePoint!

This is something I threw together when having to relink a couple dozen InfoPath libraries all containing 100-1000 forms. Why Microsoft doesn't have a check all button at the top of the page is beyond me. Here it is...

1) Open the library. Click Settings -> Form Library Settings -> Relink documents to this Library
2) Open this page in SharePoint designer.
2) Add this to the top of the page after 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.aspnetForm.chkRepair)" >

3) Save, Refresh the page, click and thank me :)!

Published Wednesday, December 24, 2008 11:20 AM by rojay12
Filed under: ,

Comments

# Getting all those Infopath forms relinked in SharePoint! - Code Junkie

Pingback from  Getting all those Infopath forms relinked in SharePoint! - Code Junkie

# re: Getting all those Infopath forms relinked in SharePoint!

Wednesday, January 07, 2009 9:50 AM by Todd Vorpahl

Saw your comments here...THANKS.  I plan to try this...not a programmer myself, but will get I.T. to help me.

Question.  Right now, every time I (re)Publish a document to my sharepoint document library...all existing forms automatically get updated to the new document (i just published)

I thought this is the point of "linking".  It did not always do this.  Any idea how i changed this (like i said, no coding has been done) and how I can get it back.  I want to control which documents should get updated and which I want to stay in the old version.

# re: Getting all those Infopath forms relinked in SharePoint!

Thursday, December 03, 2009 2:17 PM by Rolf

you can also set the rowlimit to 500 max.. that will save you a couple clicks..

# re: Getting all those Infopath forms relinked in SharePoint!

Monday, April 26, 2010 5:40 PM by pshisbey

Thanks!  And thanks Rolf - I had over 2600 to update!

# re: Getting all those Infopath forms relinked in SharePoint!

Wednesday, October 06, 2010 8:44 PM by Joshua

This is awesome.  Saved me so much flippin' time. . . and the row limit change is a great suggestion!  :-D

# re: Getting all those Infopath forms relinked in SharePoint!

Wednesday, December 22, 2010 10:19 AM by bakachai

Thanks saved me from gettin carpal tunnel

# re: Getting all those Infopath forms relinked in SharePoint!

Tuesday, February 22, 2011 11:44 AM by Kimberly

I'm not seeing the <form> tag in designer.  About what line is it located?

# re: Getting all those Infopath forms relinked in SharePoint!

Tuesday, February 22, 2011 11:33 PM by Tim

thanks! very useful code. :)

# re: Getting all those Infopath forms relinked in SharePoint!

Wednesday, March 23, 2011 2:13 PM by John Gasper

Great fix. This save me tons of time having to touch a few thousand documents. I would like to add a suggestion...

Instead of modding the page with SharePoint Designer. Just add Content Editor to the top of the page (via Site Actions -> Edit Page). Drop in the JavaScript from above, and save the page.

The JavaScript stilled worked great for me in IE9.

# re: Getting all those Infopath forms relinked in SharePoint!

Wednesday, May 04, 2011 2:59 PM by Larry

Great idea, but needs some cleaning up. This process requires a special tool, SPD. read this post and you will have a cleaner install with no special tools needed to implement or manage.

sharepointhacker.wordpress.com/.../select-all-document-library-relink-aspx

# re: Getting all those Infopath forms relinked in SharePoint!

Wednesday, July 06, 2011 11:31 AM by Sarrah

If I ever meet you, I will hug you.

This just saved us quite a lot of time. Thank you!

Leave a Comment

(required) 
(required) 
(optional)
(required)