Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How can I capture the cancel status in prev mode

Featured Replies

I have a printing script that takes a user to a print layout in preview mode and pauses to allow them to make sure everything is correct. If they hit the cancel button, I want to redirect them to a certain layout. How can I capture the cancel button being pushed? I tried doing Status(CurrentError) but that did not work or maybe I was looking for the wrong status. Any help would be appreciated!

Thanks,

John

That can be done with a "floating" control button layout (from another table). I'm sure there are examples that other folks can point you to. If not, I'll upload a sample this evening.

Allow User Abort [off]

...

Go to Layout [print layout]

Enter Preview Mode [pause]

Set Error Capture [on]

Print []

If [status(CurrentError) = 1]

Go to Layout [other layout]

End If

...

If you're going to do it this way, make sure there are no script steps (not even comments) between the Print step and the If.

  • Author

John-thanks for the floating control panel solution. It may come in handy.

Vaughan-Is there a way to capture the cancel that the preview pause offers? That is if I don't turn off Allow user abort. The way you mentioned works, but it puts in an extra step if something is wrong with the labels and they don't want to print. If something is wrong, it would be nice for them just to hit cancel on the preview screen instead of having to hit continue and then cancel in the print setup window. Maybe this isn't possible and I will have to settle with the extra step. I am just always looking for ways to simplify the process. Thanks for help so far!

John

My problem with Cancel on a preview screen is that it leaves the user right where the script gets killed, which I believe is bad interface. And if user about is on, they can kill the script *anywhere* by pressing Esc.

To get what you want you could offer the user a dialog after they click Continue...

Allow User Abort [off]

...

Go to Layout [print layout]

Enter Preview Mode [pause]

Show Message ["Print the report?", "OK", "Cancel"]

If [status(CurrentMessageChoice) = 1]

Print []

End If

...

  • Author

Vaughan, that makes sense. Thanks for the suggestions!

John

I've been experimenting combining Vaughan's suggestion with Caballero's solution:

Go to Layout [print layout]

Enter Preview Mode []

Set Zoom Level [75%]

Loop

Show Message ["Print the report?", "OK", "Next Page", "Prev. Page"]

Exit Loop If ["Status(CurrentMessageChoice) = 1"]

If ["Status(CurrentMessageChoice) = 2"]

Go to Record/Request/Page [Next]

End If

If ["Status(CurrentMessageChoice) = 3"]

Go to Record/Request/Page [Previous]

End If

End Loop

Print []

I make sure to pause at the print dialogue, so that the user has a chance to cancel. It isn't perfect, but maybe somebody could build on this approach!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.