Friday, April 30, 2010

How to Search by SharePoint ID

Initially this seemed like an odd request to me, but due the business reason behind it, it presented a unique challenge - that was very easy. Keeping in mind that SharePoint ID's are not unique, they are only unique to the list your working in so when you have several lists containing similar data a simple search could return several duplicate results, plus you would have to tweak the search in the SSP to accept a string of "ID=1234"

  1. On each list create a new view or edit your default view to expose the ID field, make sure it is #1 in the column order.
  2. *If you have Versioning enabled and Require Checkout on Edit - turn this off so you can add the Form Web Part.
  3. On your view page, Site Settings > Edit Page > Add Web Part > Form Web Part - put it above your list.
    1. By default you will end up with a text box and a "Go" button so you probably need to edit it to give users instructions to only search by ID.
  4. Once you have the web part added, you need to Edit > Connections > List Name > Leave default > Leave default so it should have read T1 and ID
  5. Edit > Modify Shared Web Part > Source Editor > paste in some HTML, for example mine is;

When your done, you will end up with something like this;

No comments: