385
Views
26
Comments
Solved
Input Validation Exercise Help
Question

Hi.
I'm doing the Becoming a Traditional Web Developer Guided Path.
I did almost all the exercise. Everything was working well, until the last part:

Add Validations in the PersonDetail Screen Now that we have added and tested custom validations for movies, we will also do the same for the PersonDetail Screen. We will add validations to verify if the Birth Date is before the Current Date, and if the Person’s Date of Birth is later than the Person’s Date of Death.


I tried to do the same as the step by step instructions told me about MovieForm.

The validations are working. I cant save with a Date of Birth after Date of Death and/or after current date.

The feedback msg tell me I need to fix the errors. Ok that part.

The issue:

Should be showed 2 msgs with error below the input fields:

"Date of birth can't be after date of death"

and

"Date of birth can't be a future date"

I would like to know where is my mistakes




2020-05-07 18-53-00
Rui Barradas
 
MVP
Solution

Hello again prtpj,

In this case, you really need an Ajax Refresh, otherwise that part of the screen won't be refreshed and those messages won't appear in the screen.

Checking on your code, you are already using an Ajax Refresh in the beginning of the action:

You just need to copy that yellow marked element in your flow and use it in the True branch of the not PersonForm.Valid condition.


Kind regards,

Rui Barradas

2025-08-07 06-30-56
Amit J
Champion
Solution

OKay,

Now  I am able to install your application and worked on it, Now messages are visible on the save button with a feedback message.


just added refresh ajax and  Input_FocusFirstInvalid at the right place. Please validate it.

https://amitj.outsystemscloud.com/OSMDb/PersonDetail.aspx?PersonId=5

OSMDb.oml
2020-05-07 18-53-00
Rui Barradas
 
MVP

Hello there prtpj,

Hope you're doing well.

It seems to me that you're just missing an Ajax Refresh, when the form is not valid.

Can you try to add an Ajax Refresh for the PersonForm element in the True branch of the not PersonForm.Valid condition and check if it works?

Everything else seems to be correct :)


Kind regards,

Rui Barradas

UserImage.jpg
prtpj

Hi Rui. I didnt think about "ajax refresh" because this isnt explained yet in the guide. I cant do a thing I dont know yet 

Will be the next lesson.


I thought the optional thing on that exercise was to do the same I did previous in all other actions mentioned at the exercise's end.

2020-05-07 18-53-00
Rui Barradas
 
MVP
Solution

Hello again prtpj,

In this case, you really need an Ajax Refresh, otherwise that part of the screen won't be refreshed and those messages won't appear in the screen.

Checking on your code, you are already using an Ajax Refresh in the beginning of the action:

You just need to copy that yellow marked element in your flow and use it in the True branch of the not PersonForm.Valid condition.


Kind regards,

Rui Barradas

UserImage.jpg
prtpj

But how should I do a exercise with a thing I didnt learn yet?? Cant I do only with I had learned?

2024-05-17 04-26-02
Maxime Baracco

Hi Prtpj,


I think Rui is right, but it's difficult to say from this screenshot only. If you need more details please include your oml so we'll be able to reproduce your issue and help better :)


Thank you

UserImage.jpg
Ellakkiya

Hi prtpj,

Without much information, can't able to find the exact mistake.

Here i have attached the oml. It's working fine.

Hope this helps!

Regards,

Ellakkiya.S


OSMDb.oml
UserImage.jpg
Ellakkiya

Hi prtpj,

Have you solved this issue? 


Regards,

Ellakkiya.S


2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi prtpj,

I think your expectations are incorrect.  

For each input, there is only one single validation message shown.  

So if multiple things are wrong with the same field, only the last assigned value of  ThatInputWidget.ValidationMessage will be displayed.

So in your case, if you want both messages to show if both validations are in going off at the same time, you could for example use the validationMessage of DateOfBirth input for signaling a future birth date, and use validationmessage of DateOfDeath input if DoB is after death.  In that case, I think I would make both inputs invalid, and set the message with DateOfDeath.

Dorine

UserImage.jpg
prtpj

Hi. I believe its not the case.
There are 2 input fields Date of Birth and Date of Death. I want a validation msg on each one, but i'm getting no msg on any of them.

2025-08-07 06-30-56
Amit J
Champion

Simple you can use a switch statement.

1  in the first condition checks both conditions if both are false then you can show both messages using Concat both.

2. in the second condition if one condition is false then show a message according to that.

3 in last if the remaining condition is false then show message according to that.

Best of Luck

AJ

UserImage.jpg
prtpj

I'm uploading the oap file which was created during lessons.



OSMDbprtpj.oap
UserImage.jpg
prtpj

And the pdf with exercise

7.5xInputValidationExercise.pdf
2025-08-07 06-30-56
Amit J
Champion

Can you share only OML. Getting issue to instal .oap in personal env.

2025-08-07 06-30-56
Amit J
Champion
UserImage.jpg
prtpj

I will try that and tell you later

The file which you asked

OSMDbprtpj.oml
2025-08-07 06-30-56
Amit J
Champion

Just remove highlighted feedback message then both messages will work.


refer my below reactive application for the same logic...


UserImage.jpg
prtpj

Hi. When I did remove the feedback msg which you marked, didnt work.

Actually only gone with warning msg at top screen 

I dont want remove this warning msg.


On Movie Detail Screen I get this error msg below the input field when the movie didnt launch yet and Gross isnt = 0

I want to get the same thing on Person Detail Screen below Date of Birth and Date of Death input

I tried to do the same as the exercise told me on Movie Screen, but something I did wrong and I dont know what.

2025-08-07 06-30-56
Amit J
Champion
Solution

OKay,

Now  I am able to install your application and worked on it, Now messages are visible on the save button with a feedback message.


just added refresh ajax and  Input_FocusFirstInvalid at the right place. Please validate it.

https://amitj.outsystemscloud.com/OSMDb/PersonDetail.aspx?PersonId=5

OSMDb.oml
UserImage.jpg
prtpj

Hi Amit.

Thx for the help

Rui already told me about Ajax (and I will try that)


But as I did question him, for me is a bit odd a necessity to use a feature (Ajax) which I didnt learned anything about it yet. I'm doing the Becoming a Traditional Web Developer Guided Path and the feature Ajax is a future lesson.


EDIT:

That ajax refresh I didnt create on my own. It was created automatically during one of the exercises.

2025-08-07 06-30-56
Amit J
Champion

Hi prtpj,

It's a strength, but I just changed Lable position for personal form and it is working now(without Ajax refresh). 

I don't know what the issue with that.


Amit Jain

OSMDb.oml
UserImage.jpg
prtpj

Hi Amit.
I got your oml and did compare with mine. I did the alterations removing the entire line with the ajax from flux:

And changed what you told me about label position, but didnt work.
One detail I didnt see was the save button method.

I did delete the Ajax line, but I didnt change the button method from Ajax to Submit:

Changing that the issue was solved without Ajax and keeping original label aligh.


Thx for all the help.


2020-05-07 18-53-00
Rui Barradas
 
MVP

Can you check if this OML works for you?


Kind regards,

Rui Barradas

OSMDb.oml
UserImage.jpg
prtpj

Sry. Didnt work

UserImage.jpg
Ravi Tighare

I am also stuck at this point as this does not given in step by step.

This is traditional web app development path, Add Validations in the PersonDetail Screen, exercise 6.8.

I think this should be done without ajax.

Kindly check attached file for reference. I am implementing validation showed on page 17. I have to refer above validations done on page MovieDetail screen save button.

6.8x Input Validation Exercise.pdf
2023-06-16 08-45-59
Devopfullstack

You need this Condition

PersonForm.Record.Person.DateOfBirth > CurrDate()

PersonForm.Record.Person.DateOfDeath <> NullDate() and 

PersonForm.Record.Person.DateOfDeath <= PersonForm.Record.Person.DateOfBirth

7.6x OSMDb.oap
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.