FREE OutSystems Workshops - Build an OutSystems App in 1 hour | ENROLL NOW

Tech Bites - Set timers to delete records

< Back to Blog

Hi, and welcome to another Tech Bite.

In this tech bite, we will demonstrate how to set timers to delete records and use an online store as an example.

In the app, we have an entity called Shopping Cart Items, where we save all the items each user is interested in buying.

 

To clear all the shopping carts nightly, we will create a server action Delete All Cart Items. 

Add a SQL node to the server action and write the necessary query to delete all records from that entity. In this case, despite Delete queries not having outputs, every SQL node needs an output structure or entity. Thus we use a dummy output.

 

Next, we’re recording in the system log that the action was completed. Add a Run Server Action to the flow and select the system action Log Message. Add its attributes, Message and Module Name. The recorded message will appear in the OutSystems Service Center logs.

 

Finally, we will create a timer on the processes Tab to run every night. Create a Timer Action Clear Carts that invokes the previously created server Action—Delete All Cart Items— which occurs Daily at 4 in the morning.

 

Now we’re ready to publish. You can check the Service Center logs the morning after to ensure the timer ran as expected.

   

Thanks and see you on our next Tech Bite!

Turn Up Academy

Apply to our Turn Up Boot Camp

AND BECOME THE NEXT OUTSYSTEMS CERTIFIED DEVELOPER
(
Instructor
)

Latest Articles

Tech Bites - Should we validate form data on server-side?

Should we validate form data on server-side

When including forms in applications, developers often wonder if they need to re-validate data on the server side after having checked it on the client. Why go to the trouble of checking the data twice?

Tech Bites
The Top 5 Mistakes Handling Asynchronous Data In Outsystems Reactive Apps And How To Avoid Them

The Top 5 Mistakes Handling Asynchronous Data In Outsystems Reactive Apps

When developing an OutSystems reactive web app, you would expect to display data quickly, but it doesn't always happen. Do you know why? We'll explore the reasons and how to tackle them.

DevZone
Tech Bites - How to use Screen templates

How to use Screen templates

Did you know that the OutSystems Platform has tens of screen templates to help you quickly put together your apps? Let me show you how you can use them.

Tech Bites