Thursday, January 20, 2011

Convert ListItem ID to UniqueID

This is just one way of getting from the ListItem ID (Not Index) to the GUID UniqueID

In SharePoint 2010 you can use SPList.GetItemByIdSelectedFields(…) or SPList.GetItemByIdAllFields(…)

Example:

GetItemByIdSelectedFields(Int32.Parse(this.ListItemID), new string[] { "UniqueId" });

If you don’t have 2010 you can always retrieve the ListItem with a CAML Query…

No comments: