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!
Have you heard about the OutSystems Developer Cloud and want to know more about what's new and what the big benefits are? Then this article is for you!
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?
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.