URL Stings in SharePoint 2010 to launch Edit Forms

This article is about generating href in SharePoint Designer and in Report Builder 3.0 to launch List forms

SharePoint Designer

This one will open your Form in Modal 2010 mode and not navigating away when closed but only works with one query string parameter for some reason.

<a href="javascript:OpenPopUpPage(‘http://PathtoeditForm’)"> Edit Item</a>

<a href="javascript:OpenPopUpPage(‘/sites/wm/Lists/WorkItems/EditForm.aspx?ID={@ID}’)"> Edit Item</a>

How to use more than one URL Query String Parameter. Note that there are 2 parameters now separated by &amp; This is case sensitive. For some reason when using &amp; in a javascript popup link it replicates to &amp;amp;amp;

http://bp.rlan.ca/sites/projects/Lists/ProjectMasterList/EditForm.aspx?ID={@ID}&amp;DefaultView=Schedule

This example does not use JvaScript and opens a List form in another site collection and returns to source when user closes form. Just put this in a hyperlink field in the DVWP and voila.

<a href=http://bp.rlan.ca/sites/wm/Lists/WorkItems/EditForm.aspx?ID={@ID}&amp;DefaultView=Schedule ONCLICK="GoToLink(this);return false">Edit</a>

Another way is to do this for a list item:

<a onclick="javascript:NewItem2(event, "http://SiteNameHere/_layouts/listform.aspx?PageType=8&ListId={ListIDHere}&RootFolder=");

javascript:return false;"

href="/_layouts/listform.aspx?PageType=8&ListId={ListIDHere}&RootFolder="

target="_self">

Submit Text Here</a>

Or this for a Library Item

<a href="http://SiteNameHere/_layouts/Upload.aspx?List={ListIDHere}&

RootFolder=" onclick="javascript:NewItem2(event, "http://SiteName/_layouts/Upload.aspx?List={ListIDHere}&RootFolder=");

javascript:return false;"

target="_self">

Text here</a>

Note: get List Id from URL after visiting the list/library in question, Replace ‘%2D’ to ‘-‘

SQL Reporting Services

Here is sample URL to Launch SharePoint Edit form from SSRS

="javascript:window.showModalDialog(‘" & "http://bp.rlan.ca/sites/projects/Lists/ProjectMasterList/EditFormBP.aspx?ID="& Fields!ID.Value & "’,null,’dialogWidth:1600px;dialogHeight:1200px;status:no;unadorned:yes;scroll:yes;help:no;resizable:yes;’);"

This one works also

javascript:void(window.open(‘http://bp.rlan.ca/sites/projects/Lists/ProjectMasterList/EditFormBP.aspx?ID=18′,’_blank’))

This is the prize link in SSRS, it will open an edit form in SharePoint across Site Collection Boundaries. Just add this to a url jump in SSRS
="javascript:OpenPopUpPage(‘" & "http://bp.rlan.ca/sites/projects/Lists/ProjectMasterList/EditForm.aspx?ID="& Fields!ID.Value & "’);"

To open an InfoPath form on a specific view of the form use this &DefaultView=View

Advertisements