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

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

Recommended Posts

Posted

How do you write a script for a custom dialog box with 3 buttons: "Ok" to save current record and exit to goto Main menu layout, "No" - do not save current record and goto Main menu layout, "Cancel" -remain at current screen to continue edit. Thanks.

Posted

Set Error Capture [ On ]

Allow User Abort [ Off ]

Show Custom Dialog [ "Save"; "Delete"; "Cancel" ;

"What would you like to do with this record?" ]

If [ Get(LastMessageChoice) = 3 ]

Halt Script

Else If [ Get(LastMessageChoice) = 2 ]

Delete Record/Request [ No Dialog ]

Go To Layout [ Main ]

Else

Commit Record/Request

Go To Layout [ Main ]

End If

Posted

""Ok" to save current record and exit to goto Main menu layout, "No" - do not save current record and goto Main menu layout, "Cancel" -remain at current screen to continue edit"

Allow User Abort [ Off ]

Show Custom Dialog [ "Save"; "Delete"; "Cancel" ; "What would you like to do with this record?" ]

# Button 1 = Save, 2 = Delete, 3 = Cancel.

If [ Get(LastMessageChoice) = 1 or Get(LastMessageChoice) = 2 ]

If [ Get(LastMessageChoice) = 1 ]

# Save record.

Commit Record/Request

Else

# Delete record.

Delete Record/Request [ No Dialog ]

End If

Go To Layout [ Main ]

Else

# Cancel script steps can go here.

End If

I avoid Halt script steps wherever possible. Halt kills all scripts and subscripts dead: that's a problem if you have some kind of looping script or a parent script paused ready to resume after the current script finishes.

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