| **Navigation:**  [[templates.htm|Templates]] > Guide to all Templates > Control Templates >====== Save Button control template ====== | [[tplcontrolrtftoolbar.htm|{{btn_prev_n.gif|Previous page}}]][[templates.htm|{{btn_home_n.gif|Return to chapter overview}}]][[tplcontrolsavechangebutton.htm|{{btn_next_n.gif|Next page}}]] | | || 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: **Allow** 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. | {{tipbox.jpg|TipBox.jpg}} 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. **View Message** Specifies the text for the action message when the procedure is called to view a record. **Insert Message** Specifies the text for the action message when the procedure is called to add a record. **Change Message** Specifies the text for the action message when the procedure is called to change a record. **Delete Message** 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. **Confirm Cancel** 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**. Specifying a key here also enables the FrameBrowseControl's "ditto" button {{c6h0054.jpg|C6H0054.jpg}}. This button also restores the value from the last saved record. **When called for Delete** Specify what displays when this procedure is called to delete a record. Choose from: **Standard Warning** Displays a message box prompting for confirmation of the delete. **Show Form** Displays the form. **Automatic Delete** 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. Choose from: **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. Choose from: **None/Window Control** Embed your own code to display the message in a control. **Title Bar** Display the message in the window's title bar. **Status 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. **Record Identifier** 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 ( ! ).