Search This Blog

Monday 9 September 2013

properties.ListItem in ItemAdded is NULL


This is a known issue and will be addressed in future. However it is very common that one need ListItem object in ItemAdded event. Workaround is to get the Listitem using ListItemId and spList.GetItemById. here is code snippet

   SPWeb oSPWeb = properties.OpenWeb();
   SPListItem oListItem = oSPWeb.Lists[properties.ListId].GetItemById(properties.ListItemId);

No comments:

Post a Comment