issue creating a link to open an infopath form

B

betsy1111

I have seen issues posted about this issue but have never seen a
resolution. I stumbled upon a resolution and wanted to post it because
I am sure it has been a headache for many just like me.

When you attempt to use a "content editor" webpart to create a
hyperlink to open an infopath document like in this example:

<a href="http://mysharepointsite/i3/site/forms/template.xsn">Click here
to add a new contact</a>

you get the error "the from cannot be opened because it requests domain
security level and is only allowed restricted security level".

I resolved this error by viewing the source of the page where the form
library is displayed and looking at what exactly the "FILL OUT THIS
FORM" button does. You will see that it runs a javascript function
called WPQ3createNewDocument();. This function is in the source so
just copy that function to your "content editor" source and call make
it the value of your hyperlink. Here is the example:
*****************************************************************************************************8
<SCRIPT>
var L_NewDocumentRuntimeError_Text = L_NewFormLibTb1_Text;
var L_NewDocumentError_Text = L_NewFormLibTb2_Text;

function WPQ3createNewDocument()
{

var strTemplate = "http://xxxxxxxxxxx/C2/Contact List/Contact
Skills/Forms/template.xsn";
var strSaveLocation = "http://xxxxxxxxx/C2/Contact List/Contact
Skills";
var strProgID = "SharePoint.OpenXMLDocuments";
createNewDocumentWithProgID(escapeProperlyCore(strTemplate, true),
makeAbsUrl(strSaveLocation), strProgID, true);

}
</SCRIPT>
<a href="javascript:WPQ3createNewDocument();">Click here to add a new
contact</a>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top