Skip to Content
Technical Articles
Author's profile photo Parthiban Sukumar

Employee Central Time Sheet – How to restrict employee entering time records in previous calendar month

Hello Readers,

Customers have asked the following scenario in EC Timesheet and hence I decided to create a short blog on that.

Scenario:

Employees using timesheet should enter their time records only for the current calendar month and restrict any entry before that. Since the current timesheet is only weekly, most weekly timesheets have overlapping months and in such case any entry before the first of month should be restricted. This means in single timesheet should have validation to enter or restrict specific entry.

E.g. of overlapping months within a single timesheet period

EE can enter time entries from 1st -5th Oct and restrict entering 29th & 30th September.

Admin: Admin should not have any restriction. EE will raise request Admin for any retro input beyond current calendar month.

Solution:

Please note that the Validation Rule of the Time Recording Profile cannot perform this check because the context of validation rule is only Time Sheet Day which will has time entry start date but not booking day object.

Also note that Time Recording Permissibility in Job Info will not serve the purpose as well.

Step1:

Go to Admin Centre -> Manage Workflow Groups -> Create New Group

Add all Time Admin user to People Pool and Update.

Step2:

Rule: Create business rule with base object as Employee Time Sheet.

Write a similar rule as above. The key here is the use of Time Valuation Result ->Booking date as validating object which serve the purpose of this scenario.

Create a message definition according your requirement.

Step3:

Go to Object Definition and choose object EmployeeTimeSheet.  Add this rule on Save Rules.

Testing:

Role: Employee: Enters data on 30th September

Role: Employee: Enters data on 1st October

 

Role: Admin

 

Hope this helps !!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Assigned tags

      10 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Malyadri Garimella Jwala
      Malyadri Garimella Jwala

      nice update with new feature

      Author's profile photo Manjunath BK
      Manjunath BK

      Nice Blog Parthiban..

      Author's profile photo Rupsa Banerjee
      Rupsa Banerjee

      Very well-written blog !! Thanks for sharing the info.

      Author's profile photo Sreekanth Garladinne
      Sreekanth Garladinne

      Useful info Parthiban! Thanks!

      Author's profile photo Cesar Santamaria
      Cesar Santamaria

      Hello Parthiban,

       

      Thanks for sharing this blog.

       

      I have tried to restrict the employee to enter those time records but i am getting this message in the rule: "Retrieved 'EmployeeTimeSheet.employeeTimeValuationResult'. Value: 'null'". Do you know what could be causing this issue?

       

      Thanks & Regards

      Author's profile photo Parthiban Sukumar
      Parthiban Sukumar
      Blog Post Author

      Hi Cesar,

      This error comes when the time type you enter is not evaluated. One of our colleague came up with the same error and it was solved.

      Make sure the time type you enter is getting evaluated in the rule, because if the if condition is "booking date" from evaluated result and not from timesheet date.  Hope this resolves your issue.

      Author's profile photo Cesar Santamaria
      Cesar Santamaria

      Hi Parthiban,

       

      The rule was not working because the field "Time Pay Type" in "Time type Group" was set to "No". I changed it to "Yes" and now the rule is being triggered.

       

      Thanks a lot for your Help!

      Author's profile photo Benedict Laforteza
      Benedict Laforteza

      Hello Parthiban,

      This is a good idea, but as per Timesheet Engineering, this configuration has a little flaw. If there is already a record in the previous month in the time sheet that overlaps two months, then the rule will prevent the update of this two-months-time-sheet. So far there is no proper solution to cover this requirement, too.

      Thank you!

      Benedict

      Author's profile photo Parthiban Sukumar
      Parthiban Sukumar
      Blog Post Author

      Hi Benedict,

       

      True, infact i'm trying to address it in our product discussion internally.

       

      Regards,

      Parthiban

      Author's profile photo Narendra Prasath
      Narendra Prasath

      Hi Parthiban,

      Thank you for blog.. It is very helpful.

      I tried the same business rule for restrict the employees for past 7 days.

      If employees try to record the timesheet before the (today - 7days). it should throw an error.

      In this case, let take a example (Today - 10/05/2021) if he try to update two days back (10/03/2021) system should not throw the error. But it is not working as expected.  system taking the (10/26/2021) records also for consideration.

      Is there any possibilities to achieve the above case