Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • James 251 posts 1169 karma points
    Nov 11, 2014 @ 15:56
    James
    0

    Setting True/False Value as Default

    Hi All,

    Working on an Umbraco 6 Project.

     

    Is there a way to set the default value of a true/false data type to true?

     

    Kind regards,

     

    J

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Nov 11, 2014 @ 16:04
    Stefan Kip
    1

    Sure, just use the ApplicationEventHandler to subscribe to the ContentService Saving event, check if the IContent is new and set the property to "1", which equals true for the true/false datatype.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Nov 11, 2014 @ 16:05
    Dennis Aaen
    0

    Hi James,

    At the moment I don´t think this is possible, to set a default value out of the box with the built in true/false, there is no configuration options on it.

    The solution right now as I see it, is to make the name of the field, so when it´s false the do the comon thing that you want.

    Hope this helps, and make sense.

    /Dennis

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Nov 11, 2014 @ 16:17
    Dennis Aaen
    2

    Hi James and Stefan,

    As I see it, it could be nice to have some configurations options on the true false data type, like set a default value. Therefor I have made a feature request for that:

    You can find the feature request here: http://issues.umbraco.org/issue/U4-5787

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft