May 26, 200520 yr 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.
May 26, 200520 yr 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
May 26, 200520 yr ""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.
Create an account or sign in to comment