Ever wanted to add an item to a list inside a Meeting Workspace? Well, I did and I couldn’t find instructions on how to. Don’t understand me wrong, I did know how to add an item to a list, but what about the instance id. This is pretty simple, every list in a workspace has a field, called ‘Instance ID’, type Integer. So just set the value of this field for each item to the correct ID and the item only shows under the specified meeting date.
Small code example (workspace is a SPWeb object):
Dim list As SPList = workspace.Lists(“aListName”)
Dim listItem As SPListItem = list.Items.Add()
listItem(“Title”) = “aItemTitle”
listItem(“Instance ID”) = 1
listItem.Update()
Update 8 june 2009: It only works for new items. Instance ID is a readonly field, so don’t try to reset it and update the listitem. It simply keeps the old value. There must be some special setting method implemented to have this behaviour.