Monday, December 03, 2012

SharePoint Field set to Required but still doesn't require Input

One of common mistake when making  content type/list using sharepoint schema is to make the required field field as

Required="True" or Required ="ture"

if you pick the value true for the the field as specified above, Visual Studio doesn't give you any error and you can deploy your content type and list with out any errors.
But when you try to enter value for field, you will see that the field is not mandatory OR no redstar (required field indication) on add form of that field.

This will not make this field required.


 ID="{070e50ac-f9c1-4d4c-b1f9-de0bcac300f6}" Name="test" DisplayName="test" Type="text"  Required="true" Group="MytestGroup" ColName="test"/>

...

 ID="0x01000a4547a7e98c46248e063d79ddd67f5c"
           Name="TESTContent Type"
           Group="MyGroup"
           Description="Test Content Type Description"
           Inherits="FALSE"
           Overwrite="TRUE"
           Version="0">


 ID="{070e50ac-f9c1-4d4c-b1f9-de0bcac300f6}" Name="Price" DisplayName="test" Required="True" />    
This will not make this field required.
 ID="{070e50ac-f9c1-4d4c-b1f9-de0bcac300f6}" Name="test" DisplayName="test" Type="text"  Required="true" Group="MytestGroup" ColName="test"/>

...

 ID="0x01000a4547a7e98c46248e063d79ddd67f5c"
           Name="TESTContent Type"
           Group="MyGroup"
           Description="Test Content Type Description"
           Inherits="FALSE"
           Overwrite="TRUE"
           Version="0">


 ID="{070e50ac-f9c1-4d4c-b1f9-de0bcac300f6}" Name="Price" DisplayName="test" Required="True" />    
This will  make this field required.
 ID="{070e50ac-f9c1-4d4c-b1f9-de0bcac300f6}" Name="test" DisplayName="test" Type="text"  Required="true" Group="MytestGroup" ColName="test"/>

...

 ID="0x01000a4547a7e98c46248e063d79ddd67f5c"
           Name="TESTContent Type"
           Group="MyGroup"
           Description="Test Content Type Description"
           Inherits="FALSE"
           Overwrite="TRUE"
           Version="0">


 ID="{070e50ac-f9c1-4d4c-b1f9-de0bcac300f6}" Name="Price" DisplayName="test" Required="true" />