How do you programatically populate a field in the back office on publish?
Hi,
Is it possible to populate a field in the back office, if the user does not enter data into it?
Also, is it different when using an archetype data type with repeating fields in it. I have a date field here that I want to populate with todays date if it is left blank.
Do you need to actually populate the field with the current date when an item is created? Is it just to use for output? if so i'd probably just use the built in createDate field if the primary field was left null.
How do you programatically populate a field in the back office on publish?
Hi,
Is it possible to populate a field in the back office, if the user does not enter data into it?
Also, is it different when using an archetype data type with repeating fields in it. I have a date field here that I want to populate with todays date if it is left blank.
Thanks a lot!
Hi Damon,
Do you need to actually populate the field with the current date when an item is created? Is it just to use for output? if so i'd probably just use the built in createDate field if the primary field was left null.
Hi Damon,
If Kerri's solution isn't what you are looking for you can always intercept Save/Publish event and set a another/default value for a property.
https://our.umbraco.org/documentation/Reference/Events/application-startup
List of events: https://our.umbraco.org/documentation/reference/events/contentservice-events
is working on a reply...