November 6, 200124 yr I've created a script that will put a user in find mode in a find layout. However if a user hits the cancel button in the middle of the find it leaves them in that find layout. What would be the best way to have the user return to the original layout if they hit the cancel button during the find? Thanks, Alain
November 6, 200124 yr Probably not the best solution but it is "a" solution Hide the status area (can be done with 'Toggle Status Area(Toggle)') This disables the user from clicking on the cancel button that appears on the left side of the screen (will also probably have to do some modifying so that the user can't hit escape to stop the script) Then you can make your own cancel button in the layout where you can switch back to the original layout/mode and stop the other script. Hope this helps
November 6, 200124 yr The two script steps we tend to start every script with are: Allow User Abort (off) Set Error Capture (on) The first disables the "Cancel" option on such things as Find and Replace. The second prevent the display of FM built-in dialogs such as the "No Records Found". The use of these prevents your scripts from stopping, you must test for errors and provide the user "Cancel" type navigation. For instance in a find: Perform Find () If(Status(CurrentError) = 401 Show Message (No records were found, OK) Go to Layout (Layout to return to) Enter Browse Mode Set Zoom Level (100%) Scroll Window (home) Toggle Status Area (hide, lock) If (Status(CurrentPlatform) = 1) Toggle Window(Zoom) else Toggle Window(Maximize) End If Also thrown into this script are steps to make sure you end up in Browse Mode and reset the view of the screen by scrolling back to the top, making sure you are at 100% view, locking the status bar, and sizing the window based upon whether you are on a Mac or PC. (a little overboard as an answer, but it gives you a flavor of the kind of things that go into advanced scripting ) -bd
July 31, 200322 yr Liveoak - thanks for the explination, I was set out to do exactly what you just described! My work is done for the day, hehe
Create an account or sign in to comment