Copied to clipboard

Flag this post as spam?

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


  • Yanick Van Barneveld 27 posts 148 karma points
    Dec 12, 2016 @ 14:21
    Yanick Van Barneveld
    0

    Hi,

    I am trying to create a "CreatedOn" field. I succesfully added a constraint in my database that will fill the field with the current datetime when I insert a record.

    Now I want to show this as a UIOMaticListViewField using the following code:

    [UIOMaticListViewField(Name = "Aangemaakt")]
    public DateTime CreatedOn { get; set; }
    

    This works perfect, but now when I insert a new item using Umbraco it also inserts a CreatedOn which is NULL, so it dont fill with the current datetime (constraint in database).

    I tryed to add a [Ignore] annotation but this didn't work. It does not load the data from the database but it works when I insert a new record to the database using Umbraco.

    Do you guys have any idea how to fix this?

    Kind regards,
    Yanick

  • Tim Geyssens 6419 posts 15020 karma points MVP 2x c-trib
    Dec 12, 2016 @ 14:22
    Tim Geyssens
    1

    Hmm sounds like you might have found a bug, as a workaround you could populate that field from code, so using the event model just before it inserts

Please Sign in or register to post replies

Write your reply to:

Draft