AnsweredAssumed Answered

Validation of time entry

Question asked by user2147901 on Jul 8, 2018
Latest reply on Jul 9, 2018 by steve.thoms

Hi, i am working on a layout that allows user to select the start time and end time using pop up menu. When the user select 13:00 as start time(s) and 14:00 as end time(e). It is ok. However, when they select 15:00 as start time and 14:00 as end time. It is not allowed.

 

I have tried the field level validation, setting the calculation as s < e for both of start time and end time fields. It seems working fine, but when i try to delete data of 1 of the fields, it pop-out an error message and asking for reverting records so it is ok. But if the user have inputting more than 1 fields. Filemaker will ask whether they would like to revert all records. Could this error message be suppressed? I know that in the normal situation, no one will delete the data of the field, but if the user would like to do so? Do i need to consider this situation?

 

If i only set 1 of the field with validation by calculation, start time > end time. User could break the rules.

 

So i try to use script trigger to OnObjectValidate on end time field. My script is shown as follow

 

if s > e or s = e

     show custom dialog(error, Starting time > End time, please check(something like that)

     clear [end time]

else

     exit script

end if

 

but again, it is better to set up onobjectvalidate for both fields so user could not select start time which is greater than the end time.

 

so i set up similar script for start time field, however i could not fill in data to start field first, i have to fill in end time first.

 

i think there is something wrong of my calculation, but i don't know what is going on.

 

I am using filemaker 15 Pro Adv.

 

Script for start time

if s > e or s = e

     show custom dialog(error, Starting time > End time, please check(something like that)

     clear [start time]

else

     exit script

end if

 

 

Thank you

Outcomes