Home      Ask a Question      My Stuff      Help   
  
Scripting - Scripting an Exception on a Lunch Break
Using the 'minutesout' keyword we can now script an exception on times between an out punch and an in punch like breaks or lunches for example.

The script below gives an example of an exception placed on a 30 minute break in TimeWorks:

if (minutesout (0) > 30 and minutesout (0) < 120)
{
exception = "Late Returning from Break";
}

The script below gives an example of an exception placed on a 30 minute break in TimeWorks Plus:

if (minutesout > 30 and minutesout < 120)
{
addalert("Late Returning from Break");
}

With the 'minutesout' script we need to set the beginning and end of a time range for it to work correctly. In the above example we set the start of the time range at anything greater than their allowed break time, in this case, 30 minutes. Since we don't want to create an exception if it's not a lunch break, we can limit the time and only include time that is less than 120 minutes. Both times can be changed to match the needs of the client.

Instead of an exception, you could also script this to show up under a Job Code column, by replacing the word 'exception' in the script above to x, y, or z.

More information on Exception scripting can be found here Scripting - Exception as well as an article on setting up clock prompts How To - Setting Up Clock Prompts.

ID
418
Category
<Unassigned>
Date Created
6/24/2009 6:47:44 AM
Date Updated
10/16/2015 7:45:39 AM
Back to Search Results