Adding a default date to a date field

Comments

1 comment

  • Official comment
    Avatar
    Mark Dyer

    Hi Mercedes,

     

    The way to set this as the default value would be to use the 'Default Value' property along with 'Process Value as Default Expression' This will set the value on creation (first save) of the Record

    The expression I would advise is to take Created Date and then set the value to be the first day of the next month minus one day:

    addDays(string(year(addMonths(createdDate(),1))) + '-' + if(month(addMonths(createdDate(), 1)) < 10, '0', '') + month(addMonths(createdDate(),1)) + '-01T00:00:00Z',-1)

     

    If this is also needs to run on Record Update then it will be necessary to move the Expression into the Expression property for the Field.

    Comment actions Permalink

Please sign in to leave a comment.