Domanda

How to add a default value to a list field when coding in sharepoint?

Here are all the possible fields: http://msdn.microsoft.com/en-us/library/ms437580.aspx

DefaultValue is not in this list.

This is my code:

<Field Name="AantalOneens" ID="{ea4ca32a-3cc3-4a39-ac35-794a7bbadee8}" DisplayName="Aantal oneens" Type="Number" Required="TRUE" DefaultValue="0" />

The default value property does not work, since it doesn't exists.

Any ideas?

È stato utile?

Soluzione

To set the default value to a field, you have to use the default element.You can find an example in the below link,
http://msdn.microsoft.com/en-us/library/ms415119.aspx

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top