I have a form in which I require a read-only date field. The initial value should be set to the current date and updated with each “Save” action. How can I achieve this?
I can do this programmatically with the DocumentBeforeCreateEvent and DocumentBeforeUpdateEvent. Is it possible to do it with SME?
Hello @n.garryyev,
in SME it is possible to use the value of Today to be assigned to a read-only date field through a computation, however, it is not possible to update the date upon each save/submit without a custom code. Once the date saved in the moment of original creation of the document is in the past, the validation prompted by re-saving will evaluate the date field as untrue, because it is no longer valid (Today is not equal to the date in the field) and the error message will show up. If the field is read-only, the user cannot actively adjust the value in the field and the saving/submitting of the form will not be possible anymore. More details about Today and Now in validation language can be found in the documentation here.
Crystal clear. Appreciate it.
