Rob Haller
in

InfoPath Dev

Rob Haller

  • Creating a Web Link or href for SharePoint New Button on InfoPath Forms Library

    Using the New button on a SharePoint InfoPath Document List is not intuitive for new SharePoint users.  It would be nice if users could simply click a web link to launch a new InfoPath Form.  Here is how to do this in a single line URL ...

    Edit a Web Page and add a web link using this format:

    <a href="BLOCKED SCRIPTcreateNewDocumentWithProgID(escapeProperlyCore('http://{SERVER}/{SITE}/{LIBRARY}/Forms/template.xsn', true), 'http://{SERVER}/{SITE}/{LIBRARY}/', 'SharePoint.OpenXMLDocuments', true)">Create a New Document</a>

    Note: if you see the words BLOCKED SCRIPT in the line above, replace it with 'j a v a s c r i p t :' without the single quotes as shown here and without any spaces.  This blog automatically replaces the key word 'java script' (when run together) and the colon with the phrase BLOCKED SCRIPT. 

    You must replace {SERVER}, {SITE}, and {LIBRARY} with your path to the forms library.  Also, you can change the phrase "Create a New Document" to whatever you want. 

    I have not done this yet, but I also believe that if you have more than one form published to a library, you will need to determine what the form's name is.  The default name of "template.xsn" is used in the example above.  So, if you have more than one published form, you may need to change "template.xsn" to whatever it is called.  You can view and manage all InfoPath templates by going to the Forms Library where the form is published, then select: Settings-->Form Library Settings-->Advanced Settings.

    There are posts similar to this on the web; however, none of them are as concise as this single line launcher.  Credit for this goes to my colleague, Phil Chuang.  Thanks Phil.

Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.