Value of date passed through input

Hello,
 I'm doing the Developing Web Apps (OutSystems 11) and in Lab7.5 in page 17, "Validations for editing people" I have been trying to elaborate a "structure" of possible failures on server side, [Exceptions and Error Messages] (in terms of inputs) and there is one detail that I need in order to determine concretely the current case: I have a form where I have "Date of Birth" and "Date of Death" as 2 of the parameters, however "Date of Death" isn't mandatory so what is the value of it or what can I use to eventually compare the current value of it, when it's not defined by the user when submitting the form.?


Thanks in advance,
Pedro Tomás

Solution

Hi Pedro,


Every input need to have a variable associated.

You can get the value that the input has through the variable defined in it.

If you have a empty date, when you save your form, the platform will save your date as 1900-01-01 because that is the NULL date in Outsystems.

The fuction to see if a date is null is NulDate().


I hope this helps,

MP



Solution

Hi Pedro,


By completing what Miguel mentioned above, you can add an if to your logic by checking if the variable is <> NulDate() .


If True: continue the flow.

If False: display alert on input to user.


I hope this helps,

MS.

Hello Miguel and Marcilio

Thank you both for your answers. I didn’t know that the null date value in Outsystems was 1900-01-01 and that I could compare it’s value with NullDate().

Thanks!