I have an issue with a very small form that processes so fast that staff often double click and I get double entries in the database.
Can a flow be used to:
Hide the button on click
Run the Server Connect Action
Wait 3-5 seconds
Show button again
I have it set up now that when button is clicked it hides the button while processing. But ot processes so fast that it is faster than a double click and the button displays again almost instantly. I’d like to delay the button being displayed or clicked on for a few seconds after it has been clicked.
Hhaha, you are clearly not on a slow pleb server like me, wish i had that issue.
I would have the button hide on click, run the server action, on server action success, show the button, this will then wait for the server to complete before it shows again.
OR
button hide on click, run server action, on server action success, notify, on notify show the button.
OR
Use an action scheduler to count 5 seconds and then show the button.
I wouldn't hide the button but only disable it, like:
<button dmx-on:click="flow1.run()" dmx-bind:disabled="flow1.executing">
Run
</button>
If the flow is to fast, you could just add a wait step at the end and let it wait for 3-5 seconds, this way the flow can not be run again in that time period and the button stays disabled.
I am having troubles creating my first flow. It should insert a record then refresh the data and then wait 5 seconds. When I click on the button, nothing happens.
You were correct! It now works to submit the form and refresh the data correctly.
Next issue .... I need to set a 'wait' at the end. I have one set up but it doesn't seem to be delaying. What value do I put in the delay for say 5 seconds?
I think Patrick just provided a wrong code. It is flowName.running - just make sure to select it using the UI, it will create the right code for you Brad