83
Views
3
Comments
how to add timer when i click on punch in button in my aplication then automatic time
Discussion

I Working on HRMS Application where if a Employee click on punch in button then timer gets start and before the 12 hours if Employee not click on punch out then there  Attendance Entity set  punch out time = punch in time  and total hours = 0



Screenshot 2023-12-09 204027.png
Screenshot 2023-12-09 205228.png
2025-01-09 14-56-57
IQ78

Hi:

1. Create a timer

2. create server action to launch the timer

3. call the server action in the button

thanks

2025-06-01 02-51-51
YASH PAL

Hi priyanshu the work around is you need to run a timer in which you need to run a server action and on that server action you need to fetch the data of only those employees whose puch in is 12 hour long. You can do this by using the diff hours() function available in outsystems by passing the current time and punch in time. 

After that you need to puch out that employee and rest condition you can manage.

Thanks hope this will help

2024-03-23 18-16-49
Bryan Villalobos

Hi Priyanshu,


First of all, you do not need to start a timer after every punch in.

The idea here is to have a running timer that runs probably every minute that checks for punch ins that are already 12 hours old AND without punch out data.

To do this, create a timer that runs every minute. Then inside the timer action, you need an aggregate that fetches records with conditions DIFFHOURS(ShiftIn, CurrDateTime()) = 12 AND ShiftOut = NullDate()

Then foreach of the record, set ShiftOut = ShiftIn.

I hope this solves your problem.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.