14 Apr 2009 @ 6:28 PM 
 

Displaying a Specific Item from a SharePoint List on a Custom Page

 

This post applies to Microsoft Office SharePoint Server 2007 and WSS 3.0

Scenario: You have a SharePoint List that is being used to track some kind of business information to automate a business process. The business process requires that once a user adds a new item to a list a workflow executes that sends an e-mail to an approver (or some other person involved in the process). The e-mail will include a link inside it that will take the user to a Custom .aspx page stored in a document library. Once the Custom .aspx page opens, it should display the specific List Item needed for review/edit. HOW DO YOU DO THIS?

Solution: The first thing you would need to do is set some things up on the Custom .aspx page. The Custom .aspx page should include a “Single Item Form”. This allows you to edit the data inside the list with a “Save” and “Cancel” button already created. In the upper right hand corner of the single item form (Data Form Webpart), you will see the drop-down for the “Common Data View Tasks”.

First, you will need to create a “Parameter” by clicking the “Parameters” link – then the “New Parameter” button. Choose “Query String” from the drop-down under the “Parameter Source” option. Now give it a name and enter something in the “Query String Variable” text box. The Query String Variable is what will be used in the URL later to identify the item (so make note of it). For web programmers, this is basically a GET variable used in the URL to supply a value later.  

Now you will need to define the Filter to use the parameter – so click the “Filter” link under the Common Data View Tasks. Once inside the “Filter Criteria” dialog, choose “ID” as the Field Name. Now under the “Value” drop-down – choose the parameter name that you just defined. This now associates a filter with the ID of the List item that will be defined by using the parameter variable. Save the Custom .aspx page.

Finally, you will need to modify the workflow that sends the e-mail when a new item is added. The workflow activity will obviously be an e-mail. Inside the body of the e-mail you will need to add something similar to the following:

<a href=”http://servername/sites/organizationsitecollection/SharedDocuments/Custom.aspx?parametername=[ID]“>Click Here</a>

Where parametername is the name of the parameter that you defined above. The [ID] portion of the URL tagged above should be added by using the “Add Lookup to Body” button. You should then lookup the ID field to be added. It will not work if you simple just type [ID]. Now save your and re-upload your workflow.

Now when you add a new item to a list an e-mail will be sent to the required user with a link in it that will take you directly to the Custom.aspx page that will be loaded with a Specific Item.

Tags Categories: SharePoint Posted By: Clinton Daniel
Last Edit: 14 Apr 2009 @ 06 33 PM

E-mailPermalink
 

Responses to this post » (None)

 


Comments are open. Feel free to leave a comment below.


 

Leave A Comment ...

 

 XHTML:
You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
\/ More Options ...
Change Theme...
  • Users » 2
  • Posts/Pages » 16
  • Comments » 41
Change Theme...
  • VoidVoid
  • LifeLife « Default
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LiteLight
  • No Child Pages.