If you have tried to program with Meeting WorkSpace, you will find that any query to GetItems from the SPList will return only the records of that MeetingInstanceID.
SPList.ItemCount will give the count of all the items in the list
SPList.Items.Count will give the count of items for the current meeting instance
Suppose you want a functionality something like this..
To achieve this you have to pass a special value i.e. -1 to the MeetingInstanceID property of the Query. This will return all the records of the list.
SPList.ItemCount will give the count of all the items in the list
SPList.Items.Count will give the count of items for the current meeting instance
Suppose you want a functionality something like this..
To achieve this you have to pass a special value i.e. -1 to the MeetingInstanceID property of the Query. This will return all the records of the list.
private void AddOpenActionItems(SPItemEventProperties properties)
{
DisableEventFiring();
try
{
using (SPSite spSiteColl = new SPSite(properties.WebUrl))
{
using (SPWeb web = spSiteColl.OpenWeb())
{
// Get all the open items for the current project selected
// from the Action Items List
SPList listActionItems = web.Lists["Action Items"];
SPQuery OpenActionItemsQry = new SPQuery();
OpenActionItemsQry.MeetingInstanceId = -1; // required to get all meeting items
OpenActionItemsQry.Query = “<Where><Eq><FieldRef Name=’Project’ /><Value Type=’Text’>abc</Value></Eq></Where>”;
SPListItemCollection ExistingOpenItemCollection = listActionItems.GetItems(OpenActionItemsQry);
if (ExistingOpenItemCollection != null && ExistingOpenItemCollection.Count > 0)
{
foreach (SPListItem ExistingOpenItem in ExistingOpenItemCollection)
{
// …
}
}
}
}
}
finally { EnableEventFiring(); }
}
1 comments:
mantap de... ;)