Jump 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.

Featured Replies

Hi everyone. I got a problem using the "Print Setup" function.

In one of my script I'm using the "Set error capture On" because I would like to cancel the script if the user press cancel. Is it normal that "OK" and "Cancel" from the "Print Setup" function return the same error which is 0 :P

For the "Print" function that works fine :

Is there a way to bypass this ?

I use FileMaker Pro 9 advanced.

Edited by Guest

Are you using:

Allow User Abort [off]

...

Set Error Capture [on]

Print Setup []

Set Variable [$error ; Get( LastError )]

Set Error Capture [off]

If [ $error = 0 ]

End If

Subject: Cancel Print Setup

Here are two “script” ideas that word for me if I want the option to cancel or proceed with a print script:

Allow User Abort [ Off ]

Go to Layout [ “H invoice” (Items) ]

Enter Preview Mode

Show/Hide Status Area [ Show ]

Show Custom Dialog [ Title: "Printing"; Message: "Do you wish to print this?"; Buttons: “OK”, “Cancel” ]

If [ Get(LastMessageChoice)=1 ]

Print [ Records being browsed; All Pages; Orientation: Portrait; Paper size: 8.26" x 11.69" ] [ Restore; No dialog ]

Go to Layout [ “Main” (ABP) ]

Enter Browse Mode

Else

Go to Layout [ “Main” (ABP) ]

Enter Browse Mode

End If

Or if you would like to know, for instance, if an invoice has been printed before, this works for me:

Allow User Abort [ Off ]

Go to Layout [ “Iinvoice” (Items) ]

Enter Preview Mode

Show/Hide Status Area [ Show ]

If [ not IsEmpty(ABP::DateInvoicePrinted) ]

Show Custom Dialog [ Message: ("This invoice has been printed on" & ABP::DateInvoicePrinted & ".Do you wish to print it again?"); Buttons: “OK”, “Cancel” ]

Else

Show Custom Dialog [ Title: "Printing"; Message: "Do you wish to print this?"; Buttons: “OK”, “Cancel” ]

End If

If [ Get(LastMessageChoice)=1 ]

Print [ Records being browsed; All Pages; Orientation: Portrait; Paper size: 8.5" x 11" ] [ Restore; No dialog ]

Go to Layout [ “Main” (ABP) ]

Show/Hide Status Area [ Hide ]

Enter Browse Mode

If [ IsEmpty(ABP::DateInvoicePrinted) ]

Set Field [ ABP::DateInvoicePrinted; Get ( CurrentDate ) ]

End If

Else

Go to Layout [ “Main” (ABP) ]

Show/Hide Status Area [ Hide ]

Enter Browse Mode

End If

Is this of any help to you?

  • 2 years later...

I'm having the same exact problem. Looking to upgrade from Filemaker 7 to Filemaker 10. Filemaker 7 sets the last error as 1 if you cancel print setup. Filemaker 10 doesn't count canceling print setup as an error.

Filemaker 10 doesn't count canceling print setup as an error.

What leads to this (wrong) conclusion?

Here's a simple test I made. Just run the script which consists of:

Allow User Abort [Off]

Set Error Capture [On]

Print Setup [Restore]

Set Field[test::text;Get(LastError)]

I ran the script in Filemaker Developer 7 and canceled the print setup. test::text is set to 1.

I ran the script in Filemaker Pro 10 advanced and canceled the print setup. test::text is set to 0.

I'm sure there's a better way to program this, but I'm more concerned with the result I'm getting.

I believe that it's the restore option: remove it and test again.

You're right, with the restore option checked, it doesn't count as an error when canceling. With the restore option unchecked, it sets the last error as 1 when it's canceled.

Hm... looks like they changed the behavior in version 9 - version 8.5 does return error 1 even with the restore option checked. However, I am not sure which one is the correct behavior - see:

http://help.filemaker.com/app/answers/detail/a_id/3199/kw/print%20setup%20restore%20error/

Thanks, that's helpful. I was thinking of trying two print setups in a row, but wasn't sure if that would give me the result I wanted. Since it's recommended in the article you linked to, I think I'll give it a try.

Create an account or sign in to comment

Important Information

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

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.