Home      Ask a Question      My Stuff      Help   
  
Scripting - How to Make a Script assign a Category to a Punch (Using Employee Setup or Clock Prompts)
Question
ID
297
Category
<Unassigned>
Date Created
8/28/2008 8:30:52 AM
Date Updated
6/25/2015 11:41:34 AM
When certain employee's clock in I want their punches assigned a category other than Regular. Can this be done?
Answer
Yes this can be done. First choose an Employee Setup field or labor code clock prompt that scripting can look at to determine when to change the category or not. The Employee Setup fields that can be used are Department, Location, Supervisor, or Home1, Home2, or Home3.

It is usually a good idea to write the script to only change the category if it is currently the default of "Regular". This will prevent the script from changing the category when a manager wants to change it manually.



In our example script we will use the Home 1 field:

For TIMEWORKS:
if (category = "Regular" and home1 = "Something")
{
category = "Warehouse";
}

For TIMEWORKS PLUS:
if (category = "Regular" and employee.home1 = "Something")
{
category = "Warehouse";
}

This means that if an employee that has "Warehouse" in Home 1 all there Regular punches will be put in the Warehouse category. To use one of the other Employee Setup fields you would just replace Home1 with one of the other fields listed above.

Another thing you can do with this is incorporate a labor code clock prompt (X, Y, and Z) to generate the category:

For TIMEWORKS:
if (x = "100")
{
category = "Warehouse";
}

For TIMEWORKS PLUS (you use the "field name" of the prompt instead of x,y,z):
if ((name of x prompt) = "100")
{
category = "Warehouse";
}


In the above example if the x prompt is setup (How To - Setting Up Clock Prompts) and an employee enters '100' at the prompt the system will assign any hours from this punch to the category 'Warehouse'.
Back to Search Results