Showing posts with label listtemplate. Show all posts
Showing posts with label listtemplate. Show all posts

Thursday, April 10, 2008

Strange issue with deployment of custom editform.aspx

I had the same issue (see below) a couple of days ago and spent a couple of hours on finding the reason for it

Here the whole thread with the detailed Solution Description:

http://forums.microsoft.com/technet/ShowPost.aspx?siteid=17&postid=3154005




Problem:
Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: Input string was not in a correct format.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [FormatException: Input string was not in a correct format.] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2755599 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +112 System.Convert.ToInt32(String value, IFormatProvider provider) +44 Microsoft.SharePoint.WebControls.ItemHiddenVersion.OnLoad(EventArgs e) +253 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

Solution:
Instead of setting the Zone-Visibility to false, add a DIV around your zone and just hide the DIV with setting style="visibility: hidden". This way round the necessary information will be rendered to the page but not shown to the user. That's it - fixed!

Monday, February 4, 2008

Boolean parameters in SharePoint definition files are CASE-SENSITIVE, crazy!

This is real SharePoint crap!!!

I just found out, that boolean Parameters in Definition Files (like List Definition, Content Type Definition, Site Columns Definition et cetera- in general all schema.xml definition files) are CASE SENSITIVE!

One example:
<Field
ID="{...}"
Required="True"

/>

This will not work. The Field will not be defined as required. Reasons: SharePoint understands only TRUE / FALSE values written in capital letters - everything else (including True or true) will be ignored and the default setting will be taken (in case of Required the default is false).

In make our example work:
<Field
ID="{...}"
Required="TRUE"
/>

This issue applies also to all other boolean parameters, like
Hidden="TRUE" or FROMBASETYPE="TRUE".

This is something I have never seen before... anyway - that's SharePoint!!!





Wednesday, January 30, 2008

HRESULT: 0x81070201 Exception

Okay okay, this is actually something very basic, but it happend now a couple of times to me. If you work on a Feature that defines a custom SharePoint List, you can run into the following Error while activating it (in this case during Site Provisioning by definitions in onet.xml):

The element 'MyList' of type 'ListInstance' for feature 'MyListFeature' (id: 794958c5-fede-4e1f-aa96-d9fcd087945e) threw an exception during activation: Exception from HRESULT: 0x81070201

The reason for this error is, that SharePoint can't find the related schema.xml file for the list to define. This can happen, if

  • You simply forgot to write an schema.xml file

  • or, what is more realistic, the Name Attribute in ListTemplate is not the same as the Folder Name you have the schema.xml File stored in.

The Name-value of the ListTemplate tag must match the name of the folder you have your schema.xml file stored in:


<ListTemplate
Name="MyListDefinition"
Category="Custom Lists"
DisplayName="MyList"

...