Valid Date of Birth

0
Hi, I want to restrict the dates someone can pick when selecting the date of birth. Like it only runs from 1/1/1900 till current date. How can I do this? EDIT: It worked!
asked
2 answers
4

Ok,

Create a constant of type date/time and set this to the minimum value that the user is allowed to enter. Create a before commit microflow in the domain model on the entity that need the check. In the microflow add a split that checks the field against the constant: $Entity/Attribute < @ModuleName.Constant Then if true add a validation feedback action that states that the field is not correctly filled in and use the constant in the message to indicate to the user what the minimum value is (be aware that the constant is of type date/time and to use it in the message it needs to be converted and formatted (very simple but not the thing you'll want would be toString(@ModuleName.Constant), but look at the formatting options in the documentation for a better solution) Then set the to return 'false' so that the record is not saved. Also add a true outgoing sequence to the split and set the end event there to 'true' so the record is saved.

If you need more, let me know and I can send you the example project.

answered
0

AFAIK you can't restrict the selection. You can however check the date entered by means of a MF for example on change of the field or on the before commit event and display validation feedback below the field that the selection is not valid.

answered