AnsweredAssumed Answered

Writing Scripts with Time Conditions

Question asked by carla.campomanes on Apr 20, 2018
Latest reply on Apr 20, 2018 by philmodjunk

Hello, it's me the filemaker noob


I'd like to know how to write a script with time in it.


I am making a daily report document with machinery parameter values that factory workers need to fill up hourly.


I've designed it as such that the first layout is the daily log (I've made a privilege set for factory workers so that this layout is read only for them). There is a button on this lay out called "Data Entry". Now, I've made 24 layouts for Data Entry, one for each hour of the day. I want to write a script so that when this button is pressed let's say at 13:15, the user will go to the layout that allows data entry for 13:00H, and if pressed at 14:25, to the layout that allows data entry for 14:00.


I am completely a noob but my idea of a script for my data entry button is something like this:


If [Get (CurrentTime) > Time (14;00;00) &  ≤ Time (15;00;00)]

     Go to Layout ["Data Entry 1400H]

Else If [Get (CurrentTime) > Time (15;00;00) &  ≤ Time (16;00;00)]

     Go to Layout ["Data Entry 1500H]

...and so on until I cover all 24 hours

End If


I couldn't even get to clicking OK - a pop up window says "A number, text constant, field name or "(" is expected here" - here refering to my ≤ operator. Something (or a lot of things) is obviously wrong.


I need this arrangement to make sure that logs are filled up in the hour that they are supposed to be filled. I would appreciate any help on this! Thank you!