April 2009 - Posts - Greg Collins
in

InfoPath Dev

This Blog

Syndication

Greg Collins

April 2009 - Posts

  • Create a Split Public/Private Form

    There is sometimes a need to have a form that works differently for public (external) vs. private (internal) use. As an example, you might want to make a simple form to be sent out via email or downloaded from a website and submits back to you via email. This could be a survey, an order form, a signup, or whatever. But once you get it back, you want to have more functionality available to you, including the ability to submit to an internal database, etc.

    In essense you have two separate forms, one for public consumption, and one for private. These can have different security modes. The public form can be restricted security, while the private form can be domain or full trust security. For this to work, InfoPath needs to consider these two forms one-and-the-same. Let's look at how you would do this.

    In the form properties dialog box (File | Properties), in the Form Template Properties section, you will find fields for Name, ID and Description. The ID is used to determine which template a form will be opened with. But this ID is dynamic. As the Name changes, so does the ID. And every time you do a Save As the Name and ID are changed. Publishing the form, however, doesn't affect the Name and ID.

    The key is that both forms have the same ID and that your private form has a higher form version number than the public form. After you've created both versions of your form, you will tell InfoPath they are the same form by setting both of their IDs to the same value. Ensure that your private form has a higher version number by updating it from 1.0.0.x to 1.0.1.x. This will ensure that your private form is always newer than your public form, and InfoPath will try to upgrade the public form to the private form because of its newer version.

    Then you can send the public form out via email or post it for download. When the user submits via email, you will click the Open Form button at the top of the Outlook message, which will open the form using the internal template. You might be presented with a dialog notifying you of a form template conflict. This will occur if you've had both forms open on your computer--since both have the same id. You can choose which template to open the form with--which will be the internal form to further process the data sent by the public user.

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