SharePoint - Change infopath Template URL sharepoint 2007

Asked By O tweezy on 13-Feb-12 07:49 AM
Hi guys,
I seem to be having an issue with my infopath form library in sharepoint 2007. I migrated a better part of this library from another library using explorer view, and I have now deleted the library I copied  from. As I try to relink the documents so my forms can update appropriately when I publish changes in my new library, I notice my Template URL is still that of the deleted library. How do I change this template URL to reflect the URL of my new template so I can relink properly.
D Company replied to O tweezy on 13-Feb-12 12:44 PM
Browse this FIXED post

Regards
D
kalpana aparnathi replied to O tweezy on 13-Feb-12 02:19 PM
hi,

You cannot do this directly like you can with other .NET applications, but you should be able to accomplish the same thing by adding an XML Document as a secondary data source.

1. Go to tools -> Data Connections -> Add
2. Recieve, Xml Document, filepath, Finish
3. A dialog will pop up asking whether you would like to add the file to the form template. Click NO.

Now the template references this file from wherever it is deployed. You can change values inside this XML file whenver you like and the next time the template is opened it will see these changes. You will probably want to put the config XML file in a network accessible folder.

Regards,
Somesh Yadav replied to O tweezy on 14-Feb-12 07:39 AM

SharePoint URL Changes and InfoPath Forms

InfoPath Form Template URL

We have a solution that makes extensive use of online and offline InfoPath forms in a MOSS 2007 environment. An upgrade to SharePoint 2010 is due in a few months, including a redesign of Managed Paths and Site Collection ‘hierarchy’ having a direct effect on the URL of our Site Collection.

I thought this meant a lot of work for converting the thousands of InfoPath XML Forms by script, because they all contained an absolute URL to the InfoPath Form Template.

However as it seems after restoring the Site Collection all forms automagically had a corrected absolute URL to their template !!

<?xml version="1.0"?>
<?mso-infoPathSolution productVersion="12.0.0" PIVersion="1.0.0.0" href="https://public.contoso.com/sites/csapp/FormServerTemplates/LeaveRequest.xsn" name="urn:schemas-microsoft-com:office:infopath:LeaveRequest:-myXSD-2009-05-29T07-59-01" solutionVersion="1.0.0.422" ?>
<?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.2"?>
<my:Data  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"
      xmlns:tns="http://public.contoso.com/webservices"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
      xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
      xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-05-29T07:59:01"
      xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"
      xml:lang="nl-be">
  <!-- Form content -->
</my:Data>​
 

Default Alternate Access Mapping

What happens is that when you restore a Site Collection backup, it looks up the Web Application by the URL you specified as a parameter. From that Web Application, it takes the Alternate Mapping configured on the "Default” Zone and uses that URL to construct the absolute URL in the InfoPath XMLs.

Only at restore time

This mechanism only seems to trigger when the restore takes place. Changing the Default AAM afterwards to a different URL has no effect. You could temporarily change the AAM for the restore operation and then set it back if you want. Beats any script iterating and updating all Form XMLs any day.


Most of the times you expect the worst from SharePoint, but then it catches you by surprise and brings a huge smile to the face :)

O tweezy replied to Somesh Yadav on 14-Feb-12 09:46 AM
Thanx a lot. I found the solution.