Properties.ListItem is null in ItemAdded event. How to get the new ListItem details that was created using sharepoint windows explorer(under Action menu)
AV1810, Response: This is a known issue. You can use code like below to workaround the issue: You can use the following code:- CurrentListItem = CurrentList.Items[CurrentList.Items.Count - 1]; if(properties.AfterUrl != CurrentListItem.Url) { CurrentListItem = CurrentList.Folders[CurrentList.Folders.Count - 1]; } Possibly another way to get the items and it's much better. if (CurrentWeb.GetFile(properties.AfterUrl).Exists) { CurrentListItem = CurrentWeb.GetFile(properties.AfterUrl).Item; } else if (CurrentWeb.GetFolder(properties.AfterUrl).Exists) { CurrentListItem = CurrentWeb.GetFolder(properties.AfterUrl).Item; } Solution is complements of : Lyublinski Wizard of MOSS
November 4th, 2011 3:10pm

Hi all, am generating a new unique id whenever a document is been uploaded in sharepoint. Am fetching the new ListItem using Properties.ListItem(SPItemEventProperties) and updating the new unique id value. It works fine for documents created using upload option. where as the 'Properties.ListItem is null' when using the "Open with Windows Explorer" option under Action Menu in sharepoint 2007. Could anyone please suggest me on this issue. Thanks.
Free Windows Admin Tool Kit Click here and download it now
November 5th, 2011 12:34am

Thanks a Lot Leonid :)
November 12th, 2011 9:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics