JavaScript

{dialog.object}deleteRecord Method

Syntax

{dialog.object}.deleteRecord([options]);

Arguments

options

Optional. A JSON object with one or more of the following properties:

options.nextRecordToShowstring

If blank, then the next record in the keylist is shown. If 'newrecord', the new record is shown.

options.confirmationboolean

A true/false value - controls if the confirmation dialog is shown.

options.serverSideCanDeleteFunctionstring

Name of the Xbasic function to call before the delete is executed.

options.serverSideAfterDeleteFunctionstring

Name of the Xbasic function to call after the delete is executed.

Description

Deletes the current record in the 'primary' table. Applies only to a component that has been bound to one or more tables.

Discussion

Applies only to a component that has been bound to one or more tables. Deletes the current record in the 'primary' table. (If the component is bound to a single table, the 'primary' table is the table to which the component is bound. However, if the component is bound to multiple (linked) tables, the 'primary' table is the top-most parent table of the linked tables.)

IMPORTANT This action can only be used if you have loaded primary keys for the primary table. You can load primary keys using the 'Get Primary Keys for Parent Table' server-side action in the onDialogInitialize event, or in an Ajax callback, using the 'Get Primary Key values for Records in a Query' action in Action Javascript.

After the record is deleted, focus will move to the next record in the primary key list that has been loaded.

A confirmation dialog will be displayed before the callback is made.

Examples

{dialog.object}.deleteRecord();

To give focus to a new record (not the next record in the key list) after the delete:

{dialog.object}.deleteRecord({nextRecordToShow :'newrecord'});

To delete without displaying the confirmation dialog:

{dialog.object}.deleteRecord({confirmation: false});

See Also