Unable to access HR Lifecycle Events case table from Scheduled job

samadam
Kilo Sage

I have a scheduled job to trigger notifications on the le_case table. I tried to run job as system admin, myself who has admin access and user that has le_case table read/write access. The job runs but fails to retrieve data even though there is matching data. What can be done to fix this?

1 ACCEPTED SOLUTION

Run this script on fix script and see how much count you are getting using the getRowCount() method.

If my response was helpful, please mark it as correct and helpful.
Thank you.

View solution in original post

9 REPLIES 9

Shraddha Kadam
Mega Sage

Hello @samadam ,

 

Please verify if users have the sn_hr_le.case_writer and sn_hr_le.case_reader roles. 

If my response was helpful, please mark it as correct and helpful.
Thank you.

Pranesh072
Mega Sage
Mega Sage

try to run your scheduled job as HR admin or Lifecycle events for enterprise administrator

Harmeet2Singh
Tera Expert

can you please share the script from where you are triggering notification?

samadam
Kilo Sage

I tried to run as HR Admin, same thing.

var edate = new GlideDate();
edate.addDaysLocalTime(5);
gs.info("In the script" + edate);
var Case = new GlideRecord('sn_hr_le_case');
Case.addQuery('u_effective_date', edate);
Case.query();
while (Case.next()) {
    gs.info("In the while script");
I could not get this statement to print