Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Overtime warning script

Featured Replies

Hello all-

I've created a staff scheduling database that calculates overtime worked by staff on a daialy and weekly basis. Supervisors enter in a start time and end time for each shift of the week and then total hours worked and overtime is calculated.

I am trying to write a script or scripts that will do two things. 1. flash up a warning message when a staff member is scheduled for more than 12 hours of overtime on a shift; 2. Flash up a warning message when there is less than 8 hours between two shifts.

I have a field for multiple staff members for each day of the week (for example staff member one's monday hours would be Staff1MonHrs). I think I know how to do the logic. For example, the first script would look like:

If Staff1MonHrs > 12

Show Custom Dialog ["Warning! Staff member is working more than 12 hours!"]

End if

How do I get the script to run as supervisors are entering in hours in the schedule database?

Any help will be greatly appreciated!

Edited by Guest

Hi

You need a calc field not a script.

IMHO you need a new field in your table (called hours warning or something like that)

It should be a calculation field. Result is text.

The calc should be like you have suggested for the script:

If(

Staff1MonHrs > 12;

"Warning! Staff member is working more than 12 hours!";

"")

End if

Then in your layout you place the field (make it see through not opaque)

When the condition is met i.e. staff hrs go over 12, the warning will appear on your layout. When the condition is not met, the calc returns "" i.e. nothing so you don't see anything.

If you like, make the text big and red and loud and over the top of what they're looking at so it really hits them in the face!

hth

Phil

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.