voltrate Posted May 26, 2005 Posted May 26, 2005 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.
MoonShadow Posted May 26, 2005 Posted May 26, 2005 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
Vaughan Posted May 26, 2005 Posted May 26, 2005 ""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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now