Hi,
I am looking for alternative solution for Sleep Component because I already have one server action in my client action if I add this sleep action, I will get performance warning.
I tried using some JS code in my workflow, but I can't see any difference because it didn't wait and execute the workflow.
Here is the workflow,
Here is the JS Code,
Can anyone help me with this?
Thanks in advance...
write the below code in js :
I actually looked for JS Code. It worked. Thanks Mayank.
Thanks for sharing
Hi @Sowndhar S,Create a client action and call the Sleep server action inside the client action(Just wrapping the Server action in client action).Then use the client action in your main flow.RegardsKrishnanand Pathak
Thanks @Krishnanand Pathak
Sorry but I don't think this reply should be marked as solution!
I unmarked it as solution.
Calling the sleep server action from s cliënt action means a http request to the server. It would work with small sleep units below 100ms, generating http calls faster then tht http request can be processed.
The other reply marked as solution is the correct one use Javascript SetTimeout()
Hey @Sowndhar S
Your logic is correct the thing you are missing is javascript in OutSystems is asynchronous and because of that it doesn't wait for your setTimeout to end and just creates a new thread to solve it you have to use $resolve with it as also pointed out by Mayank
I have also attached a working oml file that you can use to test the logic yourself. Lemme know if you have any other questions, if this solves the issue please mark the answer as correct
Cheers,
Kshitij Raheja