The scripting process can handle concatenation meaning it can append information such as adding something to the end of an identifier such as an entry from a clock prompt if it meets certain requirements for the script to activate.
Below is an example of this:
if(department <>"") { if("MTWRF" contains weekday(punchdate)) category =department +"1"; if("S" contains weekday(punchdate)) category =department +"2"; if("U" contains weekday(punchdate)) { category =department +"3"; }}
This example changes the category/job code to the department field in Employee Setup and adds a 1, 2 or 3 to the end of the department depending on the day of the punch. In this example:
1. If the punch is on Mon-Fri, it will add a 1 to the end of the department (i.e. 7985 changes to 79851). 2. If the punch is on Saturday it will add a 2 to the end of the department (i.e. 7985 changes to 79852). 3. If the punch is on Sunday it will add a 3 to the end of the department (i.e. 7985 changes to 79853).
NOTE: This script will also work in TimeWorksPlus with one change, "department" would be referred to as "employee.department".
| |