Changed item is generally accessed as follows:
SPListItem item = web.GetListItem(properties.ListItem.Url);
It will work fine as long as any modification to document name is not made. But when a document is renamed, accessing listitem as above will throw an Exception of Nativestack.
Reason: ItemUpdated() is asynchronous event. Hence, it is not necessary when code executes, new URl is available.
Instead, access the changes Listitem as follows,
properties.Web.Lists[
If you have any questions you can reach out our SharePoint Consulting team here.
No comments:
Post a Comment