20
Views
7
Comments
Solved
Help with Input Validation for people screen
Question
Service Studio Version
11.10.6 (Build 37199)

Hi i am having trouble with implementing the Add Validations in the PersonDetail Screen. Can somebody show me what i am doing wrong? Thank you in advance 

OSMDBvalidations.oml

Rank: #55
Solution

Hi Erdinc,


You have several things missing.

First, your Save action method should be set to AJAX Submit.


Then, you want to take advantage of the field validations, check the example below as I'm setting the input for dates valid and their message which now affects the Form.Valid variable.

And last but not least, AJAX refresh the form after the Valid. And also the False and True branches were swapped (now, it's ok, True goes down to create Record, False goes to the error message).


Check the OML in attachment for more details

Hope it helps.


Regards,
João

OSMDBvalidations.oml

Rank: #9632

Hello João,

Thank you for your answer i changed it but i am not getting any error messages when i try to add a date of birth after date of death and i am also not getting an error when the date of birth is set in the future.
Can you help me with this?

Kind regards,

Erdinc


Rank: #55
Solution

Hi Erdinc,


Actually the If was swapped in the validations. It is easier to understand the code if one adds labels on the Ifs and Assigns, something like this:


OML in attachment.

Regards,
João

OSMDBvalidations.oml

Rank: #9632

Hi João,

Thank you for your answer. I am still having the problem that i can still add date of birth in the future without getting an error message.

Kind regards,

Erdinc

Rank: #55
Solution

Hi Erdinc,


For that, you just need to add an if with that condition:


OML in attachment.

OSMDBvalidations.oml

Rank: #9632

Hi João, 

Thank you very much. It works now.

Kind regards,

Erdinc

Rank: #55
Solution

Hi Erdinc,


For that, you just need to add an if with that condition:


OML in attachment.

OSMDBvalidations.oml

Rank: #55
Solution

Hi Erdinc,


Actually the If was swapped in the validations. It is easier to understand the code if one adds labels on the Ifs and Assigns, something like this:


OML in attachment.

Regards,
João

OSMDBvalidations.oml

Rank: #55
Solution

Hi Erdinc,


You have several things missing.

First, your Save action method should be set to AJAX Submit.


Then, you want to take advantage of the field validations, check the example below as I'm setting the input for dates valid and their message which now affects the Form.Valid variable.

And last but not least, AJAX refresh the form after the Valid. And also the False and True branches were swapped (now, it's ok, True goes down to create Record, False goes to the error message).


Check the OML in attachment for more details

Hope it helps.


Regards,
João

OSMDBvalidations.oml

Rank: #9632

Hello João,

Thank you for your answer i changed it but i am not getting any error messages when i try to add a date of birth after date of death and i am also not getting an error when the date of birth is set in the future.
Can you help me with this?

Kind regards,

Erdinc


Rank: #55
Solution

Hi Erdinc,


Actually the If was swapped in the validations. It is easier to understand the code if one adds labels on the Ifs and Assigns, something like this:


OML in attachment.

Regards,
João

OSMDBvalidations.oml

Rank: #9632

Hi João,

Thank you for your answer. I am still having the problem that i can still add date of birth in the future without getting an error message.

Kind regards,

Erdinc

Rank: #55
Solution

Hi Erdinc,


For that, you just need to add an if with that condition:


OML in attachment.

OSMDBvalidations.oml

Rank: #9632

Hi João, 

Thank you very much. It works now.

Kind regards,

Erdinc

Hi,

You are missing ajax refresh.

Thanks