Hi peps,

So, I have been doing the Beginner Web App programming.

Until now it´s beeing a good experince, Im learning a lot about the plataform.

In a exercise I have this problem. Doing the verify of the date fiels, the date of dead needs to be later then the date of born. Can someone help me?


DiffDays(PersonForm.Record.Person.DateOfBirth, PersonForm.Record.Person.DateOfDeath) <= 1


Solution

Hi Henrique.

Whats the problem, exactly?

I see by the image a simple problem.Your DiffDays IF is not properly connected to the previous validation IF.

You should have 2 arrows connecting to this IF: First, from the previous IF, second, from the assign on the other branch of the previous IF.

But if you notice, you have only ONE arrow, the one from the assign of the previous IF.

This is because your IF is OVER the line, not ON it.

This happens when you drag an element to a line, and it already have a conection. It is not inserted on the line, than.

So, you need to select the arrow that is coming from the previous IF and is connecting direct to the Form.Valid IF, and connect it to the Dates IF 

:)

EDIT

Cheers,
Eduardo Jauch

Solution

Thanks Eduardo, that solved my problem. I didn´t notice that if was disconnected. Thank you!

Henrique Leite wrote:

Hi peps,

So, I have been doing the Beginner Web App programming.

Until now it´s beeing a good experince, Im learning a lot about the plataform.

In a exercise I have this problem. Doing the verify of the date fiels, the date of dead needs to be later then the date of born. Can someone help me?


DiffDays(PersonForm.Record.Person.DateOfBirth, PersonForm.Record.Person.DateOfDeath) <= 1



Hi, I'm curious as to what you put in the Assign on this particular task if you remembered?


As I'm also on this task but struggling. Thanks. 

Hello Aarron,

When you detect a problem with user input (IF condition), what you want is to set the Valid (to False) and ValidationMessage (warn the user about the error and solution) properties of the offending Input widget.

In order to be able to set those properties, and to find the input.Valid and input.ValidationMessage in the assign, you need to give the input a name.

Hope this helps.

Cheers.

Eduardo Jauch wrote:

Hello Aarron,

When you detect a problem with user input (IF condition), what you want is to set the Valid (to False) and ValidationMessage (warn the user about the error and solution) properties of the offending Input widget.

In order to be able to set those properties, and to find the input.Valid and input.ValidationMessage in the assign, you need to give the input a name.

Hope this helps.

Cheers.

Hi thanks for your response.
I seemed to have progressed somewhat with the task now, although I have an issue with a date of birth/date of death.

The date of death is not a mandatory field, yet not saving anything in the field still gives up an error so i assume my If and Assign is still the issue and something is out of place as everything other than that works fine. 


I'm putting money on the assignment being a bit dodgy but cant see it.


Thanks :) 

Hi,

The problem is your condition in the IF that checks if the date of death is after the date of birth.

You must remember that a date, when not provided, will have its default value that is #1900-01-01". So, in fact, when you don't provide a date of death, you're saying that it is that value, and that value seems to be earlier than the value provided for the Birth date.

To fix it, you must ensure that this validation only happens if the date of death IS provide, and you can compare a date against NullDate to check if it was provided or not.

Cheers.

Eduardo Jauch wrote:

Hi,

The problem is your condition in the IF that checks if the date of death is after the date of birth.

You must remember that a date, when not provided, will have its default value that is #1900-01-01". So, in fact, when you don't provide a date of death, you're saying that it is that value, and that value seems to be earlier than the value provided for the Birth date.

To fix it, you must ensure that this validation only happens if the date of death IS provide, and you can compare a date against NullDate to check if it was provided or not.

Cheers.


Thank you for your response, Luckily I managed to do it not long after I made the post.


I would however of managed to do it with your post so thank you for taking the time to post that for me. Much appreciated. 


Thanks