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.

Page setup cancel error

Featured Replies

In the midst of a lengthy scripted printing routine I'm issuing the Page Setup command (to enable a choice of printers). However, if the user clicks that dialogue's Cancel button the script halts and the user is dumped on an unexpected layout.

How can that Cancel button (coming from the OS itself) be trapped? Recommendations for handling this?

Assistance appreciated.

Use Error Capture in you script. After the Page Setup step, if Last error = 1, the user canceled. Take control from there and take user to proper layout.

  • Author

Use Error Capture in you script. After the Page Setup step, if Last error = 1, the user canceled. Take control from there and take user to proper layout.

In this case Error Capture show a value of Zero. If I'm not stepping through the debugger I get this message:

"Page Setup has been canceled. Do you wish to continue with this script?|Continue|Cancel"

The problem remains unsolved.

The folllowing script works for me:

Set Error Capture [ On ]

Print Setup [ ]

Set Variable [ $Error; Value:Get ( LastError ) ]

If [ $Error = 1 ]

Go to Layout [ “Child” (Child) ]

Else

Go to Layout [ “GrandChild” (GrandChild) ]

End If

  • Author

The folllowing script works for me:

Set Error Capture [ On ]

Print Setup [ ]

Set Variable [ $Error; Value:Get ( LastError ) ]

If [ $Error = 1 ]

Go to Layout [ “Child” (Child) ]

Else

Go to Layout [ “GrandChild” (GrandChild) ]

End If

Thanks Ralph. Two things I was doing wrong.

1. Assuming If[$Error] would trap. It doesn't; Get(LastError) always returns a value, if only zero.

2. Turning on Error Capture way at the beginning of the script would carry through throughout and that I could afford to capture the error status after some additional steps. They don't. Must be done immediately before and after the Print Setup[] step.

Thanks again.

As you discovered, error capture occurs with each script step, that's why it's often handy to store it in a variable, so you can keep going and then deal with the errors at a later point in the script.

You can put the Set Error Capture at the beginning of the script. It appears right before the Print Setup because that is the beginning of my little script.

  • 2 weeks later...

I came across your thread when having the same problem. Apparently having the Page Setup/Print step set to [Restore] will not give an error code. Refer to;

http://filemaker.custhelp.com/cgi-bin/filemaker.cfg/php/enduser/std_adp.php?p_faqid=3199&p_created=1115172695&p_sid=*PAQHGmj&p_accessibility=0&p_redirect=&p_lva=&p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9OSw5JnBfcHJvZHM9ICZwX2NhdHM9JnBfcHY9JnBfY3Y9JnBfcHNfYW5zX3VwZGF0ZWQ9JnBfcGFnZT0xJnBfc2VhcmNoX3RleHQ9Y2FuY2VsIHBhZ2Ugc2V0dXA*&p_li=&p_topview=1

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.