September 2009 - Posts - Jo-Anne Alfafara
in

InfoPath Dev

Jo-Anne Alfafara

September 2009 - Posts

  • How To Deploy A Form To Multiple SharePoint Libraries

    There are times when you want to deploy a template to multiple SharePoint form libraries. For example, multiple teams may use the same template but need to keep their documents separate. The typical way to do this is to deploy the form twice, once for each library. However, a few problems arise when you do this:

    • If a user tries to open a form from the other library, they will get the form conflict dialog even though the form is supposed to be the same.
    • A user who has cached a form from one library cannot view forms from the other library offline. InfoPath thinks they're different.
    • To deploy form updates you have to republish to each library separately.
      There is a little known feature whereby you can publish the XSN template to one location and then reference it in multiple SharePoint form libraries. The steps to do this are as follows.

    DEPLOY A TEMPLATE.XML FILE

    1. Deploy the XSN to your shared location. It can be on the same SharePoint server in a document library (using the deploy to file share publish wizard option) or any file share or web site.
    2. Launch the form from that location and immediately save a blank form instance and call it "template.xml"



    3. Next, browse to the first form library where you want to publish the template. In the top right View dropdown, click Explorer View. In SharePoint 2003, you can find this link displayed in the left column.

    4. You will see a Forms folder. Double-click that to go there.

    NOTE: Make sure Show hidden files and folders option is selected in your Folder Options. Otherwise, the folder will not be displayed.

    5. Once Forms folder is opened, you will see a file called template.xsn.

    6. Right-click the template.xsn and delete it.
    7. Copy the template.xml file you created earlier into this folder.

    8. Click Form Library Settings in the library toolbar. If you’re using SharePoint 2003, click Modify Settings and Columns in the left column.

    9. Under General Settings, click Advanced settings.
    10. In the Document Template field, rename the Template URL from template.xsn to template.xml. Note you might think you could point directly to the other XSN from here but you can't because this link can only be a file in this library.

    11. Click OK and you're done!
    12. Now when you click New button in the SharePoint library toolbar it will launch the form that you deployed in the central location.
    13. Repeat for other libraries where you want to use the same template.

    DEFAULT CONTENT IN THE TEMPLATE.XML FILE

    An advanced use of this can also be to have the template.xml file have some prefilled content that you want users to have when launching a new file. At step 2, fill in the default form data and save that locally. You can make a different copy of the template.xml with different default data for each library (only 1 per library). Then upload that file and when the user clicks in the library to create a new form, that default data will be pre-populated.

Copyright © 2003-2014 Qdabra Software. All rights reserved.
View our Terms of Use.