DataForm Web Parts - removing the GUID

DataForm web parts enabled us to put forms onto pages that can interact with SharePoint lists. Why would we want to do this? well one example is that we can hide the list and it's URL's , another is that the form can be designed to contain custom logic, be pre-populated with data (e.g. from the query string) or simply to only show a limited number of fields.

I use SharePoint Designer to create these as it a a great tool to manipulate the XSLT required. However, by default, Designer will use the list GUID to connect to the list. This poses a problem - when we transfer this webpart to another server (staging / live etc) the GUID will be different.

However, with a small amount of editing of the source, we can make the webpart work on other servers.

The changes required are...

a) In the DataSources string, replace
ParameterKey="ListID" DefaultValue="{YOUR_GUID}" Name="ListID"
with
ParameterKey="ListName" DefaultValue="YOUR_LIST_NAME" Name="ListName".
Note you must do this for each action e.g. UpdateParameters, DeleteParameters

b) In the ParameterBing string replace
ParameterBing Name="ListID" Location="None" DefaultValue="{YOUR_GUID}"
with
ParameterBing Name="ListName" Location="None" DefaultValue="{YOUR_LIST_NAME}"

c) In the main xslt, change
<xsl:param name="ListID">{YOUR GUID}</xsl:param>
to
<xsl:param name="ListName">YOUR_LIST_NAME</xsl:param>

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Sharepoint Podcasts

I travel by train  to the office regularly now. Although this sometimes takes longer than driving, it is more consistent and it gives a couple of hours a day where I can do some reading without interuption (plus I feel I'm doing my bit for the planet! :) )

This will seem geeky, but I get fed up listening to CD's or the radio (though Classic FM is a great soother) and have recently started getting the SharePoint podcasts. personally I find the podcasts easier than webcasts (perhaps because I don't have the distraction of the PC?). You can download the mp3's or find them via iTunes

These are hosted by our friends at Lightning and have some great content for developers and administrators.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

 

Dilbert of the day