Hi all,
I am developing an app where I keep an inventory of computers, and I need to have a checkbox where the user clicks to leave it active if the computer had repairs in the last year. If this field is active, it should be cleared and return to its default state after 12 months.
Is this possible?
Thank you, Luana Silva
Luana Silva
Hello Luana,
Hope you're doing well.
Yes, it is possible by using a Timer.
You'll have to create a Timer in your module that runs once per day (or any frequency you like). In that timer, you are able to run any logic you want.
In this case, you have to save the date of the last repair (let´s call it LastRepairDate) in the database. Everytime the timer runs, you need to compare the CurrDate() with the LastRepairDate, if the difference is more than 12 months, you should update the boolean (let's call it HadRepairsLastYear) to False.
Kind regards,
Rui Barradas
Thank you so much it worked very well.