properties.ItemEventProperties.ListItemId gives 0 but when I enumerate this list (in another event receiver) ListItem.Id gives 1 for same item.
There only one item in this list, not sure why the values are diffrent:
CamlQuery query =newCamlQuery();
query.ViewXml ="<View/>";
ListItemCollection itemColl = ConfigList.GetItems(query);
clientContext.Load(itemColl);
clientContext.ExecuteQuery();
foreach (ListItem item in itemColl)
{
if(item.Id == id) //where id isproperties.ItemEventProperties.ListItemId
{
//some code
}
}
I tried getting the item by below approach but this gives exception:
ListItem item = ConfigList.GetItemById(id);
clientContext.Load(item);
clientContext.ExecuteQuery();//getting Exception ‘Item does not exists…”
Please help.