Using HTTP-EQUIV to refresh a page

Consider this scenario. A patient enters a tele-health kiosk, fills out an InfoPath survey and privacy agreement form and clicks a submit button. The form thanks the patient for filling out the info and alerts a nurse to start an interactive session. As the nurse and patient interact in their session, the form automatically brings up a new form in the browser window ready for the next patient.

There’s probably a better way to do it, but using HTTP-EQUIV in the tag is a simple way to automate that InfoPath thank and refresh process. For example, have the InfoPath form open to a ThankYou page that contains something like the following Meta tag which opens the form and uses &Source to refer back to itself:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
	<head>
	    <meta HTTP-EQUIV="REFRESH" content="5; url=http://sitecollection.site/formlibrary/someungodlylongformstringhere...etc...&Source=http://sitecollection/site/shareddocuments/ThankYouPage.htm&DefaultItemOpen=1">
	    <title>HIPAA Acknowledgement and Authorization for Treatment Success</title>
		<style type="text/css">
			body {
				background-color:#FFFff0
				}
			.thanks, .note {
				margin-left:auto; 
				margin-right:auto; 
				width:70%;
				text-align:center;
				font-family:Arial, Helvetica, sans-serif;
				color:#666666;
				}
			.thanks {
				margin-top: 300px;
				font-size: 24px;
				}
			.note {
				font-size: 14px;
				}			
		</style>
	
	</head>
	<body>
		<div class="thanks">Thank you.</div><br/>
		<div class="note">Your form has been sent, and the appointment will begin soon.</div>
	</body>
</html>

References:
See article and article

Automatically closing a SharePoint 2010 Edit form opened from a Reporting Services web part

SharePoint 2010 Edit and Display forms can be modified with InfoPath. This opportunity comes with a few new bugs, but the UI and functionality can be compelling.

It takes a snippet of Javascript, but a Reporting Services web part can open one of these new list or library Edit forms with a GoToURL action. On submit or close, however, the form will either close to the list it came from or it will close to a “This form has been closed” window. It matters not whether the form is opened in the same window (target = _self) or in a new window (target = _blank). Nor does it matter if the form is set to close on submit. Neither option closes the form back to the page that launched it, and both interrupt the user flow with additional clicks to close the form window.

If adding code to the form page is a non-starter, one workaround is to close the form to another page where script can be added. This is done using the &Source part of the URL string that opens the window.

Step 1 – Create a simple SharePoint ASPX page. This can be done using SharePoint Designer 2007 (adds the basic ASPX lingo automatically), Visual Studio, NotePad++, or etc. That should result in something like the following tags:

<%@ Page Language="C#" %>
<html dir="ltr">
	<head runat="server">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
			<title>Untitled 1</title>
		<meta name="Microsoft Theme" content="Providence 1011, default">
	</head>
	<body>
		<form id="form1" runat="server"></form>
	</body>
</html>

Step 2 – Add Javascript to the section that has the page close itself on open. Calling open() first, bypass a potential window close confirmation dialog box.

<script language="javascript" type="text/javascript">
    window.open("", "_self");
    window.close();
</script>

Step 3 – Save the page as “Close.aspx” and upload it to a Document Library on the SharePoint site that is easy to access.

Step 4– Set the &Source parameter in the Report Builder web part’s URL expression to the url of the Close.aspx page. This is the URL that InfoPath will return the user to after the browser form is closed. The example below links to an Edit form in an External List that opens a specific item based on its BDCIdentity ID:

="javascript:void(window.open('http://sitecollection/site/Lists/ListName/Item/editifs.aspx?ID=" + Fields!BDCIdentityKey.Value + "&Source=http://sitecollection/site/Pages/Close.aspx','_blank'))"

The resulting link should open the Edit form in a new window, and when the form is saved or closed, it goes to the close.aspx page that closes instantly, leaving the user back at the window of origin.

References:

  • http://johnliu.net/blog/2011/6/17/infopath-2010-close-the-browser-window.html