I'm trying to retrieve an item from a list, just for demo purposes. But, when I try to do that, I'm getting a
ServerException on the
This is the exception:
An exception of type 'Microsoft.SharePoint.Client.ServerException' occurred in Microsoft.SharePoint.Client.Runtime.dll but was not handled in user code Additional information: Item does not exist. It may have been deleted by another user.
And this is the code:
clientContext.Load(clientContext.Web.CurrentUser); var lists = clientContext.Web.Lists; clientContext.Load(lists); var spList = lists.GetById(Guid.Parse(SPListId)); clientContext.Load(spList); var spListItem = spList.GetItemById(7); clientContext.Load(spListItem); clientContext.ExecuteQuery();
I've narrowed the problem down to the
GetItemId(SPListItemId) method. I'm quite sure that there is an item with the given
SPListItemId, cause when I open the properties of the specified file, I see that the
ID parameter is 7.
Does anyone know what is happening?
Thanks a lot!