I have recently "upgraded" to SP2013 from SP2010. My infopath 2010 forms go through an approval workflow. In the tasks created by this workflow is a link to the document:

enter image description here

This link opens the document in Infopath Filler (if installed) not in browser which is requiered. My old workaround was to add a small java script to the WrkTaskIP.aspx file on the server:

<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
//check if this page is the WrkTaskIP.aspx page.
//get the content link that this workflow task applies to
var linkToForm= $(".ms-informationbar").find("a");
//check if the content is an xml file. It applies to all XML files included in InfoPath Forms.
// If you used to manage regular XML files in SharePoint libraries you will need to add additional filters to this function.
if (linkToForm.attr("href").indexOf(".xml")>-1)
//replace the link
var newLink = "FormServer.aspx?XmlLocation=" + linkToForm.attr("href") + "&DefaultItemOpen=1" ;

However, I cannont get this to work on SP2013 (the link remains unchanged).

I can hide the link by adding another javascript to the master page in SP2013 but adding the above code in the same place does not change the hyperlink.


jQuery( document ).ready(function() {

if(window.location.href.indexOf("WrkTaskIP.aspx") > -1) {


The form opens in browser fine under every other circumstance.

Is there a solution to this in SP2013? (I have little to no expirence with java and the above code was taken from other guides, I do not have access to Infopath 2013)


2 Answers 2


This setting would be based on the settings in the Form Library holding the InfoPath forms. Under advanced settings, select Open in Browser instead of client.


Still no answer but I thought I'd post our "workaround" for others:

We had to purchase InfoPath 2013 so we could edit the tasks form. We added a read only hyperlink field to display the variable "Related Documents" to the form. We added a rule that changed the value of Related Documents whenever the field did not contain the text "DefaultItemOpen=1", this rule changed the value of the url to one that contained DefaultItemOpen=1 in the correct format. We added this field to all views of the form so it would be visible to people that were viewing the "requested change" form etc.

We then hid the link up top by adding the following JavaScript to the main page file (inside the head section):

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>  
<script language="javascript" type="text/javascript">    
    jQuery( document ).ready(function() {    
    if(window.location.href.indexOf("WrkTaskIP.aspx") > -1) {    

This looks prettier than the solution we were originally working towards, but I’m sure that it could have been achieved with the right JS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.