Jump to content

Cancelling a script


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

Recommended Posts

I have a script which Enters preview mode and pauses for input (continue or cancel)

If the user hits continue then i simply carry on with the script, but if they hit cancel i want them to go to another layout rather than just return to same layout in browse mode.

I have tried using if (Status(CurrentMessageChoice= 2)) but it goes nowhere just into browse mode as though it was not there.

I am not sure exactly where to put this line to make the thing work.

Any help please?

Link to comment
Share on other sites

Clicking on "cancel" button in status area will exit the current script.

Instead using Enter Find Mode [Pause] use simply

Enter Find Mode[]

the rest of the script should reside in an other script called for ex. "sPerformFind"

All you have to do is to provide 2 buttons on your find layout:

"Perform Find" with "sPerformFind" script attached to it

and

"Cancel" with Cancel script attached to it

Dj

Link to comment
Share on other sites

Thanks for hte reply but I need the user to start off in preview mode so that they can see a sorted and grouped report on the screen.

The problem is the cancel button as you say stops the script dead but I really need them to go to a different layout if they hit cancel.

I do not want them to stay there in browse mode

Any help?

Link to comment
Share on other sites

If you still want the status area to show but without cancel button, put Allow User Abort [off] step at the begining of your scrip.

I think what you want to do is hide the status area completely so the user does not have the option to cancel. They will have to hit Enter to continue.

But if they hit "esc" key you'll remain on the same layout.

Dj smirk.gif

Link to comment
Share on other sites

  • 5 months later...

I don't think johnrh ever got what he wanted, because I am looking for the exact same thing. Consider this scenario:

I am on a nice looking layout designed for a computer screen (buttons, etc.)

I want to click a button to print the data on another layout designed for a printer (the print layout.) Preview Mode and pause functions are great, but what if I don't like the preview? I should be able to cancel using FileMaker's built-in Continue / Cancel buttons, but it appears as if FM treats that action as Halt Script (as opposed to Exit Script.) This leaves me in Browse Mode on the very un-user-friendly print layout. I either have to select the computer screen layout in the Layout Menu, or specifically put layout navigation buttons on the print layout and hide them from printing.

My point (and I think johnrh's point also) is that the Cancel button SHOULD be harnessed and controlled to point the user back to the computer screen layout designated in the script.

I further tried messing with the Status(CurrentError) function, but was unable to find an adequate error for a user cancel. The error code of 1 is supposed to indicate a "User cancelled action," but I suspect this is if they hit Escape (PC) or Command-Period (Mac) in the middle of a script.

Can we nail this problem down?

Link to comment
Share on other sites

I wanted to do something very similar, and while my solution may not be what you want, it works for my needs.

I, too have reports that the users will need to print. I have buttons on the layout that say 'print such and such'. When I click the button, it goes to a layout that looks exactly like what gets printed, but in browse mode. I have two buttons on THIS layout that are 'print' and 'back'. Print runs a script that switches to ANOTHER layout that looks exactly like the origin layout, (this one with much smaller text so it looks ok when printed)prints, and then returns to the layout with the print and back buttons.

Basically, I'm giving the user a false print preview by using a form in browse mode. The actual printed form is actually a different layout, but the user never sees that.

I realize this may not be what you're looking for, but it's a similar-type solution. Granted, it's a bit of a pain redo-ing the form, changing the font sizes and field positions, but it works well for me. Hope this helps!

Link to comment
Share on other sites

You can preview a layout and be in browse mode too!

While in preview, perform a Copy command: a picture of the currently previewed page is copied to the clipboard. Now paste this image into a global container field and display this field in browse mode on a layout. Ta daaaa!

An alternative method I've used is to enter proview mode and pause; when the user hits the Continue button the get a dialog which asks whether the want to print or cancel. I'd suggest that this method will be easiest to integrate into your existing solution.

Link to comment
Share on other sites

This topic is 7634 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
×
×
  • Create New...

Important Information

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