I created a custom field for a content type I am creating using the XML below.
<Field ID="{GUID}" Required="False" DisplayName="Likes" Name="Likes" Type="Number" SourceID="http://schemas.microsoft.com/sharepoint/v3"><Default>0</Default></Field>
The field is meant to be used as a counter of sorts, and will be incremented programmatically. But, I can't get the value to default to "0" when a new item is created. However, for some reason, when I create a new column manually using the Site Collection settings page and configure it to default to "0" it works as it should.
So far, I've tried the following tactics:
- I removed the "default" element from the field definition, and set the "DefaultValue" attribute on the content type definition.
- I exported a definition for the manually-created, working column (using an Imtech STSADM tool). Then, I added it to my field definitions XML and modified the IDs so that I could add it to my content type. When I did this, it still didn't work, even though it was exported from a working column!
Any idea why this isn't working for me?