Thursday, October 09, 2008

My Daily SharePoint Frustration - VII

The errors:
File Not Found. at Microsoft.SharePoint.Library.SPRequestInternalClass.CreateListFromFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl)
at Microsoft.SharePoint.Library.SPRequest.CreateListFromFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl)
at Microsoft.SharePoint.SPListCollection.CreateListFromRpc(NameValueCollection queryString, Uri& nextUrl)
at Microsoft.SharePoint.ApplicationPages.NewListPage.BtnOk_Click(Object sender, EventArgs args)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)

on the ASP.NET page. And

"Cannot find doc TE<" in the SharePoint logs. This happens when I try to instantiate a list from my custom list template.

What I was trying to do:

I was trying to declare a list template within a Feature with XML. And the list template had a custom schema.xml file with the details of the list template.

The cause of the error:
"Bad" view definitions inside the schema.xml.

The solution:
Check that you have a View element inside schema.xml that has at least one View with BaseViewID="0". Check that there's some other View element with Url="AllItems.aspx" and set as default view. And don't forget to compile only when it's full moon.

(Note: also check the list Title and Name. At some point the Title seems to be the list Name, or vice-versa... Go figure.)


Anonymous said...

Thanks for posting this. I guess you have to start with an existing List Template already in the 12/TEMPLATE/FEATURES directory and then customize from there. When you create a schema.xml by stealing parts of manifest.xml from an exported template, it doesn't seem to work. Thanks for sharing your sleuthing! You saved me some work.

Gustavo K-fé said...

Thanks, Jeremy. Even though it is 'risky', it is actually possible to import a list template from a manifest of an stp file. See my next frustration here. Cheers!