June 7, 200520 yr I have a fully scripted Find Mode for my users. I'm trying to decide whether or not to allow user abort when triggering the find script. If I do, I want to capture the fact that the user canceled the find mid-way through and direct him or her somewhere...and right now I can't figure out how to make that work. Is it possible??? FYI, I've tried Error Caputre On and Get ( LastError ) = 1 (user cancelled action), but it didn't work. Thanks! -Rob
June 7, 200520 yr The script will be cancelled if the user hits the cancel button on the status bar. Instead, don't allow user abort, but add a button to the layout for cancelling. This should have an Exit Script or Halt Script option on the button, and can then execute whatever script you wish for leaving the find process (Be sure to Enter Browse Mode[] within the script.)
June 7, 200520 yr Author I've done this. However, I was hoping to capture the "Cancel" on a sort or find once it has been initiated. In other words, I create a script that includes a sort step. If the user clicks Cancel in the sorting records dialogue, I want to capture that action and continue the script. I guess this is not possible.
June 7, 200520 yr Capturing the Cancel in a Sort dialog or other dialog is different from cancelling a Find. Cancelled dialogs will return a 1 for the get(lasterror) function. Just make sure you check for this error immediately after the script step you are checking.
June 8, 200520 yr Author Interesting...I created a little test script and it worked when cancelling a sort. However, my find mode has several calculated (and non-indexable) fields on it. If these fields are searched and the user cancels the "Processing Query" dialogue, the script simply stops. It does not continue with the remaining steps, including the Get ( LastError ). Any thoughts???
Create an account or sign in to comment