Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//This schedule job will Execute daily
var hrProf = new GlideRecord('sn_hr_core_profile');
hrProf.addQuery('user.active', true);
var diff = [];
hrProf.query();
while (hrProf.next()) {
var start = new GlideDateTime(hrProf.probation_date);
var currentDate = new GlideDateTime();
var gdt2 = new GlideDateTime(currentDate.getDisplayValue());
diff = GlideDateTime.subtract(gdt2, start);
var res = diff.getDisplayValue().toString();
var days = res.substring(0, 2);
var datediff = diff.getNumericValue();
var dateDifferenceInDays = Math.floor(datediff / (1000 * 60 * 60 * 24));
if (dateDifferenceInDays == "30") {
var hrCase = new GlideRecord("sn_hr_le_case");
hrCase.initialize();
hrCase.hr_service = gs.getProperty("Probation HR Service"); //Probation HR Service
hrCase.opened_for = hrProf.user.manager; // Manager of the user
hrCase.subject_person = hrProf.user;
hrCase.opened_by = hrProf.user.manager;
hrCase.state = '10';
hrCase.short_description = "Probation HR Case for " + hrProf.user.getDisplayValue();
hrCase.insert();

}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#contribution 2
I want to create Probation HR case for employees after 30 days of probation end date, means difference b/w current date & Probation end date should be 30 days in Schedule wise.This schedule job will be Executed daily basis. Here, HR case will create for active employee.Probation date field is available in HR Profile.
HR case will store HR Service, state,subject person,short description, Opened by,Opened for etc.
Loading