Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / productivity / Office

InfoPath GUID Updator

4.00/5 (1 vote)
31 May 2009CPOL1 min read 19.7K   168  
Update the Infopath Managed Data Connection's GUID without open file
InfoPath_GUID_Updator.jpg

Introduction

Do you face difficulty to deploy your infopath form to other servers which have a different GUID in the development server. After deploying, your form may not be able to retrieve data from the SharePoint List due to failed access to a particular data source.  

Background 

In my case, I have to frequently deploy my Infopath form to the production server which has a different GUID for some of the SharePoint Lists. So I have to re-add the data connection in production server in order to retrieve correct GUID and to do this, I needed to install Microsoft Infopath and VSTA in production server as well.

I think this is a nightmare for deployment when you only have remote desktop to do this and with the super slow response of remote.  

Afterwards, I decided to write an application to update the GUID for me. First we must know the GUID in development and production server in order to configure in an XML file. When you run on this application, all the GUID will be replaced automatically.  

Using the Code

To define the development and production GUID, you need to configure in syn.xml

XML
<?xml version="1.0" encoding="utf-8" ?>
<guidsyn>
  <group>
    <syn type="Hearing" development="{C1433D1A-934B-4E22-8CB7-581F97CFAC0D}" 
	production="{C1433D1A-934B-4E22-8CB7-581F97CFAC0D}"></syn>
    <syn type="Court Users" development="{03EB7AC1-A94D-4467-B037-9A1CBB669BE3}" 
	production="{AC6599FC-5301-46FD-8093-B724541AD3C8}"></syn>
    <syn type="Signature" development="{A9AF447A-177C-4BA4-A481-F6DFDEFBDF04}" 
	production="{1098B1E0-7264-4989-9F3E-B197B7A23919}"></syn>    
  </group>
</guidsyn>

Points of Interest

  1. You only need to configure the syn.xml once, then it can be re-used for other infopath form.    
  2. Provide option to update GUID from Dev->Prod or Prod->Dev. 
  3. This application can be used on xsn or browser-enabled xsn.  

History

  • Created on 25/05/2009  

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)