Deleting records in a databaseGoLive provides a form Action that allows you to delete records from a database. Needless to say, you must be very careful with delete actions. The standard action GoLive provides will only delete one record at a time. To perform more extensive deletions, you will need to implement a custom action using GoLive extensibility capabilities. The Delete action is applied on a form that is showing content from a single, specific record. The values in the form fields are not used in determining which record to delete; it is always the record from which the values came that is deleted. The content source must select one record either because of query filter settings (creating a test that selects exactly one record) or because of record navigation URL parameters (causing the more general content source to pick one specific record). The record navigation URL parameters are set as a result of arriving at the page from a link with a link action set. Link actions such as Show Details of Current Record and Show Next Record (or Last, First, Previous) will cause the content source to select a specific record. To set up a form for a record deletion:
You can have more than one submit button on the form, each with a different action. For example, the form can have a button to update the current record, to delete it, and to copy it. Make sure you have set up proper database permissions for the Web server to make deletions or for the identity specified in data source to make deletions. Remember that when your action is being processed on the server, the Web server's identity is used to validate file access. The Web server's identity is also used to validate database access unless there is another identity specified as part of the data source. Database restrictions on deletion will apply. For example, in most cases, you cannot delete records through a view. |