Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I have chosen to print records from a separate file and offer the Print Setup (Windows) to the user - to offer them a choice of printer. If the user cancels the Print Setup Dialog how can I get him back to his original layout?

Hope someone can help.

Posted

Thanks for your reply.

This stops the Error Dialog (Continue/Cancel) but when I choose to cancel but I still end up with a printed copy because of the Print script step (presumably).

That's what I'm trying to avoid so if the user selects the cancel option the script is "stopped" and is then returned to their original layout.

Posted

User cancelled action is Error 1. So...

Alow User Abort[off]

Set Error Capture[on]

Print[]

Set Field [ gError, Status( CurrentError ) ]

Set Error Capture[off]

If [ gError = 0 ]

# Print was successful.

<stuff to do when print happens>

Else

If [ gError = 1 ]

# User cancelled action.

Go to layout[original layout]

Else

# Some other error has occurred.

End If

End If

I prefer to put the error code into a global number field (gError) so it can be used later (the CurrentError variable gets reset after each script step processes, even comments).

Posted

Now i tried my suggestion in my PC.If understood you truly - it does what you want.See attachment. Press print button, then choose cancel.

print.zip

Posted

Alow User Abort[off]

Set Error Capture[on]

Print[]

Go to layout[original layout]

...

Now i tried my suggestion in my PC. If I understood you truly - it does what you want. See attachment. Press print button, then choose cancel.

Your method above worked perfectly for me. In response to the earlier comment about this method, it does not print after hitting "Cancel" because that "Cancel" button is for printing. (Cancel for the script is suppressed by the steps above.) The script then continues and takes the user back to the original layout. This was short and sweet which is what I needed in my client's office at 2 am. Thanks.

The other solution looks great for situations that are more complex than mine.

This topic is 7124 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.