Cancel button with warning message

This is a nice little script for a cancel button or action.

This is a nice little script for a cancel button or action. I relied so much on this website to write it, it's only fair that I share it. When pressed, it presents a message box asking the user if they really want to cancel. "No" is the default selection, which returns them to the form. "Yes" closes the form without saving or prompting the user to save, and returns them to the selected view.

Be sure to include the SaveOptions and ToCancel fields in your form.

The the QuerySave entry is not always necessary, but may be used if you have other stuff or buttons going on to verify the cancel decision.


 In the cancel button/action: Sub Click(Source As Button) Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Set uidoc = workspace.CurrentDocument Dim answer As Integer answer%=Messagebox ("You have made a request to quit. This action will_
void this entry form. Are you sure you want to do this?", 308, "Warning!") If (answer% = 7) Then Call uidoc.refresh Else Call uidoc.FieldSetText ("ToCancel", "Cancel") Call uidoc.FieldSetText ("SaveOptions", "0") Call uidoc.Close Call workspace.OpenFrameSet ("IViewSet") End If End Sub Then in your QuerySave event, put this: Sub Querysave(Source As Notesuidocument, _ Continue As Variant) If ( source.FieldGetText( "ToCancel" ) = "Cancel" ) Then continue = False End If End Sub

Dig Deeper on Domino Resources - Part 3

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close