Home      Ask a Question      My Stuff      Help   
  
Scripting - AddEntryScript rule
This scripting rule can auto add entries to the time card. The new keyword that is only available in this scripting box is addentry

The addentry method takes three arguments in the following format:

addentry("type", amount, "category");

"type" would be either an "hours" or "amount" entry.
You do need the "" around the type and category.

So if you wanted to auto add entries Monday through Friday in the amount of 8 hours, you would use the following:

if("MTWRF" contains reportingdate.weekday){
addentry("hours", 8, "Regular");
}

If the client were to want to auto pay $50 every pay period, you would write the following:

if(reportingdate.date = reportingdate.payperiodend){
addentry("amount", 50, "Bonus");
}

IMPORTANT: The addentry script runs once per day and cannot access data related to an individual punch. That means you cannot use any scripting keyword related to punches. For example, the following keywords and functions cannot be used:
--intime
--outtime
--hours
--category
--addalert
--clock prompt field names
--minutesout / minutestil
--touches
--hourstopunch

However, you can use scripting keywords related to the date (like "weekday" or "reportingdate.isholiday") or total values for the date. For example, any "reportingdate" keywords, such as:
--reportingdate.date
--reportingdate.totalhours
--reportingdate.isholiday
--reportingdate.hourstodate
--reportingdate.depthours
--reportingdate.totalday (note: Using this you will want to set the value for your "totalday" under ReportingDateScript).

NOTE: A typical use is to just to create a line on the time card and adjust values in the "PayEntryScript" rule. In some cases like when dealing with weekly or pay period hours and deductions (breakseconds) this could fail due to the time card life cycle causing it to run too soon to catch the breakseconds. In cases like this adding the script to the "OTThresholdScript" can fix this by giving you the right calculations.

ID
1689
Category
>Support
  Scripting
Date Created
10/7/2015 7:45:08 AM
Date Updated
4/14/2020 11:50:14 AM
Back to Search Results