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

    CreatedOn

    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

  • Comment author was deleted

    Dec 12, 2016 @ 14:22

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies