Hello,
I have server action that I want to run using timer. I need the timer to run [it] after the first 30 seconds every 5 seconds (if the timer is to run for 3 mins, I need it to run after the first 30 seconds meaning at 30,35,40,...). How to achieve this?
Hello Mohamed,
You can check the documention related with Timers, i think that might help you: https://success.outsystems.com/documentation/11/developing_an_application/use_timers/create_and_run_timers/
Best Regards
Hi,
You can use a long running timer and the forge component 'Sleep' to achieve this. Please refer to:
https://www.outsystems.com/forums/discussion/92652/execute-the-server-action-every-5-seconds/
You can make a client side logic to run at a specific interval say 15 seconds, 20 seconds etc , via setinterval() functional in JavaScript.
Please refer to the discussion,
https://www.outsystems.com/forums/discussion/68777/javascript-timer-in-outsystems/
Hi, @Mohamed Zakaria
I have one suggestion, you can use one local variable that is invoked time when the timer invoked first store that time in one local variable after use if widget to check difference between current time and invoked time if there is difference of 30sec you can run your logic on interval of every 5sec.
let me know if it works for you or not ?
You can look at this example @Mohamed Zakaria, adapt it and improve it.
Best regards
You use a busy-loop to time things, which is generally not a smart way to do things (it takes maximum processor power while achieving nothing).