24
Views
2
Comments
Solved
Clean data after 12 months
Application Type
Traditional Web, Reactive

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

2020-05-07 18-53-00
Rui Barradas
 
MVP
Solution

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

2023-05-15 15-43-24
Luana Silva

Thank you so much it worked very well.

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