John Liu .NET

View Original

Setting up a draft save location for InfoPath web forms

 

This is a quick description of how you can set up a draft Forms Library for letting your users save their InfoPath web forms quickly.

  1. Create an InfoPath 2010 form, set compatibility level to web browser forms
  2. Create an external secondary connection for submitting to your primary Form library.  /My Project/My Forms/
  3. Add some required fields and set them to "Can't be blank"
  4. Add a button to call the submit connection. 
  5. Publish the form to the forms library.
  6. When you click Submit - the submit will fail - because you have fields that has failed the validation.

Because you probably have workflows listening on the Form library, to keep things simple, you should create a second Form library for draft forms.

  1. Create a second Form library. /My Project/My Draft Forms/
  2. In Form Options, enable Save or Save As for web browser forms
  3. Publish the form template again.

Trick

The trick is to provide Forms Server the hint that /My Draft Forms/ is the destination for temporary draft saves.

The MSDN article is here: http://msdn.microsoft.com/en-us/library/ms772417.aspx

The URL for new forms should be:

https://server/applications/My Project/_layouts/FormServer.aspx?XsnLocation=~sitecollection/My Project/My Forms/Forms/template.xsn&SaveLocation=~sitecollection/My Project/My Draft Forms&Source=~sitecollection/My Project/My Forms&DefaultItemOpen=1

This URL uses /My Project/My Draft Forms as the SaveLocation.

Fire up the web form from this URL

Try saving the form from the save button on the ribbon.

clip_image002

Figure: Forms Server asks if you want to skip the error and save.

image

Figure: Forms Server asks the user to give a name to the draft form.

image

Figure: Forms saved to the separate Draft forms library.

 

Result

 

  1. Creating new form using the modified URL.
    1. Can save to /My Draft Forms/ - will be prompted form name
    2. Can submit to /My Forms/
  2. Opening draft form from /My Draft Forms/
    1. Can save back to /My Draft Forms/
    2. Can submit to /My Forms/
    3. CON: Leaves old draft form file
  3. Opening existing submitted form from /My Forms/
    1. Can save to /My Forms/