How to change the default InfoPath Url form server for a form library in SharePoint

By default, MOSS directs browser-based InfoPath forms to the /_layouts/formserver.aspx page with query string parameters that define the form to display or edit. We have defined our own page (for a number of reasons) and would like to route the forms to the form library. The page can be placed in the same _layouts folder in the document library, it doesn't really matter.

It looks like there should be a link (hopefully in a configuration setting form) that tells SharePoint where to send forms.

Thank!

+2


source to share


2 answers


If you are using SharePoint lists or form libraries to display a list of forms, you can add jquery rewrite (either in the custom editor web part or master page) to find links to the FormServer.aspx link.



<script type="text/javascript" src="~/_layouts/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){

  //Rewrite Form Links to Open in Custom Page
  $("a[href*='/_layouts/FormServer.aspx']").each(function()
  {
     var formFileName = this.href.figureOutWhatFormAndParamsYouNeed()
     var formServerUrl = 'https://server.example.com/_layouts/CustomPage.aspx'
     this.href = formServerUrl
  });
})
</script>

      

+2


source


Look at ServerFiles at 12 Hive under "Template \ XML". It has file extensions and mapping to redirect url.

You can see that there is a mapping for XSN and XML files against InfoPath.



I haven't tried this and obviously the normal caveats apply when changing files in 12 Hive.

+1


source







All Articles