Introduction

K2 InfoPath Integration gives users the option to make use of InfoPath Form Services to open and submit InfoPath forms.  Currently, if user tasks are accessed outside or inside the web browser in such a manner that the original URL (URL referer) is not linked to the open task the form will close immediately after submitting the form.

This behavior is now configurable to either continue closing the browser after submission or to redirect to the SharePoint Home page after submitting the form. Accessing the task from a web browser where the request contains the original URL (a valid URL referer) the browser will redirect to the original page the task was opened from after submitting the form.  In other words, if the task is opened from a web browser where the URL referrer is valid, the new configuration flag is not used and the original page will be displayed when the form closes.

Note that the default behavior will still remain that the web browser will close after submission if no configuration exists and the original URL is not (no URL referer) detected. 

 

Scenario

 

  1. Create a process with InfoPath Integration from any of the K2 Designers.
  2. Ensure that “Web Browser” is selected as the Form Client on the InfoPath Form Deployment Location page in the InfoPath Integration Process wizard.
  3. Add InfoPath Client Events.
  4. Deploy the process and start an instance.
  5. Open the user’s worklist item.
  6. The worklist item will open in a web browser.
  7. Submit the form.
  8. The web browser closes after submission.

Configuration

 

This hotfix is contained in the latest hotfix update package.

Configuration

The choice now exists to either close the web browser after submitting the InfoPath Form or to redirect to the SharePoint Home page.  Follow the steps below.

To redirect to the SharePoint Home page

The following setting must be added to the <Appsettings> node in the Runtime Services web.config file.  The file can be located in “[Program Files]\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\K2\RuntimeServices\web.config”

 

<add key="CloseAfterSubmit" value="false"/>

 

To revert back to the current default behavior, simply set the value to ‘True’.

Expected behavior

 

Task

CloseAfterSubmit   setting

URL referer

Expected result

Open InfoPath Form from the K2 worklist web part in K2 Process Portal

Setting not added to web config

None

Web browser will close after submission

Open InfoPath Form from the K2 worklist web part in K2 Process Portal

True

none

Web browser will close after submission

Open InfoPath Form from the K2 worklist web part in K2 Process Portal

False

none

Redirect to the SharePoint Home page after submission

Open InfoPath Form from the K2 worklist web part in K2 Process Portal

False

yes

Redirect to the K2 Process Portal page after submission

Open InfoPath Form from other location than web browser

Setting not added to web config

None

Web browser will close after submission

Open InfoPath Form from other location than web browser

True

None

Web browser will close after submission

Open InfoPath Form from other location than web browser

False

None

Redirect to the SharePoint Home page after submission