| 1 |
In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button and select Delete Record. |
|
The Delete Record dialog box appears.
 |
| 2 |
In the First Check If Variable Is Defined text box, make sure Primary Key Value is selected. |
|
You specify the primary key value later in the dialog box. |
| 3 |
In the Connection pop-up menu, select a connection to the database so that the server behavior can connect to the affected database. |
| 4 |
In the Table pop-up menu, select the database table that contains the records that will be deleted. |
| 5 |
In the Primary Key Column pop-up menu, select the table column that contains record IDs. |
|
The Delete Record server behavior will search this column for a match. The column should contain the same record ID data as the recordset column you bound to the hidden form field on the page. |
|
If the record ID is numeric, select the Numeric option. |
| 6 |
In the Primary Key Value pop-up menu, select the variable on your page that contains the record ID identifying the record to be deleted. |
|
The variable is created by your hidden form field. It's has the same name as the name attribute of the hidden field and is either a form or URL parameter, depending on the form's method attribute. In our example, the variable is a form variable called hiddenRecID. |
| 7 |
In the After Deleting, Go To text box, specify a page to open after the record has been deleted from the database table. |
|
You can specify a page that contains a brief success message to the user, or a page listing the remaining records so that the user can verify that the record has been deleted. |
|
The completed Delete Record dialog box should look as follows.
 |
| 8 |
Click OK and save your work. |
 |
|