Jump to content

return to original layout after a canceled find


alain
 Share

This topic is 6661 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

Probably not the best solution but it is "a" solution tongue.gif" border="0

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

Link to comment
Share on other sites

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 wink.gif" border="0 )

-bd

Link to comment
Share on other sites

  • 1 year later...

This topic is 6661 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.