2

By default MOSS directs browser enabled InfoPath forms to the /_layouts/formserver.aspx page, with the 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 direct the forms in the form library there. The page can be hosted in that same _layouts folder, in a document library, it doesn't really matter.

Seems like there should be a linkeage (hopefully in a form of a configuration setting) that tells SharePoint where to direct the forms.

Thanks!

tstojecki
  • 1,480
  • 2
  • 19
  • 29

2 Answers2

2

If you are using the SharePoint lists or form libraries to display the list of forms, you could add a jquery rewrite (in either a Custom Editor Web Part or Master Page) to look for 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>
jwmiller5
  • 2,584
  • 1
  • 15
  • 34
  • Good thinking outside the box. I was looking for some sort of configuration setting, but until we find one, your solution might be the one to go with. – tstojecki Feb 22 '11 at 12:39
  • How do you pass-in the form ID to open if it's not a new form? – PeterX Sep 29 '15 at 02:31
1

Have a look at the ServerFiles in the 12 Hive under 'Template\XML'. This has file extensions and a mapping to a redirect URL.

You can see there is a mapping for XSN and XML files in relation to InfoPath.

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

statto
  • 492
  • 2
  • 6
  • 16