|Navigation: Templates > Guide to all Templates > Control Templates >====== Save Button control template ======|
The SaveButton template provides an OK button for your window, plus the capability to display an action message for the end user. The SaveButton handles most of the file I/O for the procedure.
The SaveButton template provides the following prompts:
Check any combination of the three boxes to specify permitted file I/O operations. Conversely, clear the box to prevent the associated operation.
|Inserts||Generates code to handle record inserts.|
|Changes||Generates code to handle record changes.|
|Deletes||Generates code to handle record deletes.|
The SaveButton template does not detect changes to BLOBs; therefore, if only the BLOB changes, the SaveButton template does not save it.
Field Priming on Insert
Field Priming lets you provide a default value for fields in a new record. This value supersedes any initial value specified in the data dictionary. You can select a field and set an initial value in the Field Priming dialog.
Messages and Titles
Press this button to open the Messages and Titles dialog to specify update messages and their locations. In addition, this dialog controls some fundamental behavior associated with the procedure, such as whether it confirms before canceling and whether it allows repetitive adds.
Specifies the text for the action message when the procedure is called to view a record.
Specifies the text for the action message when the procedure is called to add a record.
Specifies the text for the action message when the procedure is called to change a record.
Specifies the text for the action message when the procedure is called to delete a record.
On Aborted Add/Change
Specifies the action to take when the user presses the Cancel button while adding or modifying a record. Choose from:
Offer to save changes
Displays a message box prompting to save changes before cancelling.
Displays a message box prompting asking if you really want to cancel.
Cancel without Confirming
Displays no message before cancelling.
Field History Key
Specify a key that restores the value from the last saved record. When the end user presses the specified key, the generated code retores the field with focus from the previously processed record.
The default key is CTRL + H.
When called for Delete
Specify what displays when this procedure is called to delete a record.
Displays a message box prompting for confirmation of the delete.
Displays the form.
Allows records to be deleted without a display or prompt for confirmation.
After successful insert
Select one-at-a-time insert mode or repetitive insert mode.
Return to caller
Generates a RETURN to the calling procedure following a successful insert. This results in a one-at-a-time insert mode.
Insert another record
Does not generate a RETURN to the calling procedure following a successful insert. This results in a repetitive insert mode.
Ask the user before adding another record
Does not automatically generate a RETURN to the calling procedure following a successful insert, but asks the user whether to add another record.
Location of Message
Specifies where the message displays.
Embed your own code to display the message in a control.
Display the message in the window's title bar.
Display the message in the window's status bar. Optionally specify which section of the status bar in the Status Bar Section box.
Display Record Identifier on the Title Bar
Check this box to append a string to the caption on the window's titlebar. Specify the string in the Record Identifier field.
Specifies the string to append to the titlebar caption, which you can use to identify the record. Type a string in the Record Identifier box. To use a variable name, precede it with an exclamation point ( ! ).