Sunday, July 31, 2011

List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user.


Recently I faced an issue after migrating a SharePoint 2007 Portal from one farm to another, using stsadm export/import method. On some pages there were Content Query web parts fetching data from certain lists. After import they stopped displaying data and the message on the CQWP was:

"This query has returned no items. To configure the query for this web part, open the tool pane"

Clicking on the "open the tool pane" link or editing this web part caused the page to refresh with the message:

"List does not exist. The page you selected contains a list that does not exist.  It may have been deleted by another user."

In the source portal when CQWP was configured, it put the GUID of the list and the selected columns. During importing of the content on the destination farm, all the lists & columns were created with new GUIDs, thus the CQWP could not find the source list and thus gave error during edit.

To get around the error I exported the web part and opened it in notepad.
There was an entry:  
<property name="ListGuid" type="string">280569DE-6723-4840-BF61-75F02E4226DC</property>

Deleted this line, as there is another line which specifies the List name:
<property name="ListName" type="string">LIST NAME</property>

Look for the GUIDs in the webpart and replace them with the Column names.
E.g. I had applied filter in the webpart on the column "ProductTypeKey".
The resulting entry in the webpart was:
<property name="FilterField1" type="string">GUID</property>
After editing the entry was:
<property name="FilterField1" type="string">ProductTypeKey</property>
Look for similar entries and replace the GUIDs with the Column names.

The same situation can occur with the DataView Web Parts also and the solution is:
1) Export the web part
2) Edit it in notepad
3) Replace the list GUID (after ListID) with the name of the list
4) Replace all occurances of "ListID" with "ListName"