Restrict to add past date to the Valid From field

I would like to ask how is possible to restrict to add past date to the Valid From field for example in the ITShop request.
Because it is not too realistic to add a past date.
Anybody have any ide how is possible to restric that?

Past Date

Parents Reply Children
  • HI Kiran,

    you can always do a proxy property which has that date restriction.

    HTH,
    Geraldine

  • Hi Geraldine,
    Thanks for replying!

    Actually we have a case where manager or access management team onboards contractors from IT Shop under responsibilities -> People -> Add a new contractor.
    On this add a new contractor form we have entry date attribute for which validation should be in below form:

    Entry Date: Manager/Access Management team should not be able to select past date, only current date/future dates are valid, if he selects past date, current date should be set.

    For achieving the same, I have modified the property (entry Date) and added a validation which calls a script and script validates if the selected date is valid or not. I want to pass one parameter as user selected date from the form and type as entrydate, which will be validated in the custom script CCC_EntryDateValidation.

    For now I was passing the first parameter as current date by using select getDate(), but I need to fetch the user selected date from the form to be passed in the script. I am not sure how can we fetch the form values.

    Am I on correct track to acheive this or this can be done in some other way also like you said proxy property? 

    Appreciate your response.

  • there are so many ways...
    You can do with your solution.

    But for a form, where a user needs to choose a date, and the date should be greater than today(), it is more user friendly to let the user only choose dates in the future. The validation does work, of course, but you'll just get frustrated users.

    You'll just need to find out where the selected date is stored. So basically from <collection> select (current) <desiredDate> (where <some nice where clause>)

    HTH,
    Geraldine

  • Thanks for your reply Geraldine, will try to achieve it.

  • Hi, have you tried then?
    Could you give more details where to put the condition to show only dates in the future? Because I would like to do the same for the "entrydate" in the new employee form
    Thanks,
    Roberto