Home      Ask a Question      My Stuff      Help   
  
Scripting - Having Scripts Trigger after a Set Amount of Days after their Start Date in Employee Setup
This article is for employees who may get certain things after a set amount of days after their initial hire date. For example after a 90 day review (from their hire date) they get a rate increase or get put into another pay/job code or category like from say "Probation" to "Full-Time".

I'll use the same 90 days as our example and through a script change the employees status from "Probation" to "Full-Time". So if it is less than 90 days from their hire date his category will be "Probation" and if it is equal to or over 90 his category will change to "Full-Time".

What we will need in advance is the Hire date. This needs to be in "Start Date" of Employee Setup. The only thing to make sure is that ALL employees have a "Start Date" entered in Employee Setup. If this is left blank the script will trigger. We will use the hire date of 07/1/2010 which would make our 90 days be 9/29/2010.


Now for the script:

if (punchdate - startdate > 90)
{
category = "Full-Time";
}
else
{
category = "Probation";
}

So in the script we do a simple subtraction of our punch date (punchdate) from our start date as we entered in Employee Setup's Start Date field (startdate). If the date of the punch (punchdate) is greater than 90 days of our "Start Date" field in Employee Setup (startdate) then change the category to "Full-Time". If not their category should be "Probation".

Below is a screen shot of this working using our 7/1/2010 hire date.




ID
496
Category
Training
  FAQ's
Date Created
9/16/2010 7:52:13 AM
Date Updated
9/20/2010 7:28:25 AM
Back to Search Results