Home
> Sharepoint 2007 > properties.ListItem in ItemAdded is NULL – Workaround to get ListItem
properties.ListItem in ItemAdded is NULL – Workaround to get ListItem
i saw this question alot on forums and decided to BLOG it for quick reference. 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);
Categories: Sharepoint 2007
Thank you very much. It worked