Granting Recall TimeSheet button to all timecard users

GregF2
Tera Expert

We have a requirement to allow all users to recall their own timesheets from timesheet portal after Approved/Processed. Servicenow baseline is to only allow timecard_approver and timecard_admin role to recall timesheets.  I found the script include 'TimeCardUIActionHelper' and updated the canRecall function section to replace the role 'timecard_approver' with 'timecard_user'.  And that did not do the trick.   I'm guessing there is something I need to do on portal side too.  I'm also concerned I may be heading down a dangerous path.  Don't love the idea of modifying this script inlcude.  Any suggestions on how I can handle?  Hopefully I'm just overlooking something.

1 ACCEPTED SOLUTION

Miguel Donayre
ServiceNow Employee
ServiceNow Employee

Hello Greg,

In this case, you will have to modify the SI to grant the "timecard_user" to recall a time card. You will need to modify this SI - TimeCardUIActionHelper

I add this line of code an i got it to work on the portal 

(gs.hasRole('timecard_approver')||gs.hasRole('timecard_user'));// added the timecar_user 

find_real_file.png

 

 BEFORE the SI mod - 

find_real_file.png

AFTER the SI mod -

find_real_file.png

It's not that big of a modification.  I would leave a comment to know it was changed for future references.

I hope that helps!!

 PS I also add the line of code to the 'TimeSheetUIActionHelper' SI and it worked as well. You can see the Red button in the picture for the timesheet recall. 

find_real_file.png

 

View solution in original post

6 REPLIES 6

Hi @Miguel Donayre Can you clarify the line of code added to display the red "Recall" button? I am not seeing it in any of your screen shots. One a side note, thank you for the information. adding the role helped me. I also added the "Submitted" state to allow the Recall function.

 

Regards,

Jeremy

Sorry I did this for a customer years ago and do not have access to the system anymore.  I also wouldn't be surprised if things have changed since then and it may not be the best solution anymore.