How to enforce exactly 40 hrs entry rule before submission of Time Cards and Timesheets?

dattanarend
Tera Expert

Hi Experts,

I have a requirement in Time Management where I need to ensure that users can only submit their Time Cards and Timesheets if exactly 40 unique hrs have time entries.

  • If users submit with less than 40 hrs → Submission should be blocked.

  • If they submit with more than 40hrs → Submission should also be blocked.

  • Submission should only proceed if exactly 40 hrs have time entries.
    Important: I want this validation to work for both Time Cards and Time Sheets.

3 REPLIES 3

GlideFather
Tera Patron

Hi @dattanarend,

 

it sounds understandable, where are you blocked? Can you share your errors, blockers, or other obstacles?

What have you tried yourself?

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


hi @GlideFather , 
we have modified the out of the box script include-TimeSheet, checking the condition of time sheet  submited totals hrs is equal to the 40hrs or not (line :- 376-379). 
but this seem to be not working as expected, can you please help me here ..?

dattanarend_0-1751640592283.png

dattanarend_1-1751640605697.png

 

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@dattanarend 
you can try to use Time Sheet policy for this

Create a time sheet policy 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader