Jump to content
Sign in to follow this  
alain

return to original layout after a canceled find

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Liveoak - thanks for the explination, I was set out to do exactly what you just described! My work is done for the day, hehe smile.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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