The good news is my layouts load quickly. The bad news is double-clicks seem to carry over to new layouts. I have this problem with two solutions I have for clients where they will double-click on an item in a list and it takes them to a new layout which has a portal or another list directly below where the mouse is, and the second click goes through to that screen. I'm thinking I need something like an "onRecordLoad wait 1 second and trap all clicks" sort of script.
Has anyone else experienced this? Any suggested workarounds?
I'm not sure how you are going about double clicking with your method. Often times, we create a variable with the timestamp from the first click, this first click does not do anything. The second click then looks at the previously recorded timestamp and if less than 0.3 seconds have passed then an action is performed, otherwise it behaves as if it is only a first click.
Since going to a new layout usually takes more than 0.3 seconds (or whatever length of time you specify here), then this usually isn't an issue. You could also use a JSON parameter and capture both the timestamps and the current active object name to determine if the exact same object was double clicked. By utilizing an object name (or field name) and maybe even including the layouts name in the parameter, you can then determine that if less than 0.3 seconds has passed and the layout name is the same and the layout object is the same, only then perform an action.. This should solve your problem.
Totally, agree with all above. You should pass in a param to make sure it was the same object clicked. That might be a simple string or maybe contains more info about the layout/record you're on.Double Click.fmp12 (268 KB)
Thanks ya'll. Super helpful. I don't think @KyleWilliams or @jwilling's solution will work, but it's the bones of what I need.
My problem is the second click carries through to the new layout... so what I did was I set a global (cringe) variable on the first screen called $$DoubleclickTimestamp on click ONLY IF it's >3 seconds, then on the second screen where the double-click gets carried over to I only run the script if its been 3 seconds. This should give enough time for even my slowest windows users to double-click and miss it...