Skip to main content

Cloud

“List does not exist” error in SharePoint

We had a page with a few custom web parts on it, and some users would get this error message while others did not. Obviously since some users didn’t get the error, the lists must all at least exist, so I first assumed it was probably a permissions thing on one of the lists being accessed by one of the custom web parts.

After an exhaustive check of permissions on every list in the site, I was able to rule that idea out. The message "List does not exist" didn’t seem to be exactly helpful.

With some trial-and-error I was able to narrow it down to one web part, so I opened the code and started walking thru it. I finally found the culprit… in one section of the code I found something like this:

SPUserCollection groupUsers = theGroup.Users;

So you see the code is trying to get a list of all the users that belong to a particular Group. In this case, different users would get different values for theGroup, and it would not always be a group they belonged to. Here’s where it would break.

If the current user didn’t belong to the Group, the Group would need to allow Everyone to see it’s members, which is luckily a property of a SharePoint Group – just go to the Group and select "Group Settings" from the "Settings" dropdown:

Group settings

Once that was set to "Everyone" on the Groups, the problem went away. Of course, another (possibly better) way to fix this would be to run the code under elevated permissions. But at least I got to the bottom of the error.

And the lists did exist 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.