Webdirect, latency, and unexpected script behaviors

Discussion created by fbm1 on Jul 19, 2018
Latest reply on Jul 23, 2018 by philmodjunk

One of the challenges I sometimes wrestle with as a FM developer, is anticipating all the actions a user may take that would be outside of the workflow, or just plain crazy, and developing safeguards to prevent bad things from happening to the data.


A little while ago while testing a Webdirect solution with a few users, things did not go as well as they did when I was testing it myself.  I noticed that one user in particular was impatient with the increase in latency that sometimes occurs with WebDirect over WAN when compared to FM Pro over LAN.  This user would click, click, click on buttons as if several rapid clicks would make things happen faster. Of course it didn't do anything to increase the responsiveness of the solution, but it did create some unexplainable results.


A little testing made me think that the script steps were "stepping" on each other from the rapid clicks, meaning that between the first click and the second click, the first script step had not completed before the second one was initiated.  A call to FM support confirmed that this has been known to happen with WebDirect.


My solution to this was to create a global field that is populated at the beginning of a script and to hide my buttons when the global field has a value.  (A second grayed out button with no script step attached is hidden behind the primary button). After the script completes the global field is set to null. This prevents users from executing the script more than one time and ensures it completes before the active button is shown.


Does anyone have any other suggestions that have worked well for them to prevent this issue from occurring?