How to set default values for boolean columns

I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.

I've tried to set default value at column level:

  <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en espaol"
         Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
  </Field>

and at content type level:

      <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
But in any case, when i create a new item with this content type, default value is applied.

Can anyone tell how to set default values for boolean columns?

Thanks in advance,

Regards,

May 25th, 2009 2:35pm

In your field definition try <Default>1</Default>

Free Windows Admin Tool Kit Click here and download it now
May 25th, 2009 3:14pm

In the field definition you can set

<Default>1</Default>

or

<Default>0</Default>

How to set the default value Null?

March 27th, 2014 5:05am

simple, does specify nothing  and it will be null.
Free Windows Admin Tool Kit Click here and download it now
March 19th, 2015 8:47pm

simple, does specify nothing  and it will be null.

<Field ID="" Name="" Type="" />  

without the Default tag.

March 19th, 2015 8:49pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics