The Delete Detail Records server behavior A server behavior is a reusable component for server-side development. They add blocks of code to your pages for accomplishing specific tasks. Dreamweaver comes with several default server behaviors and the InterAKT extensions add many more to this list. allows the developer delete all detail records depending on the one used in the transaction A transaction is a group of SQL statements whose effects are logically connected. Anything from simple queries to inserting, and deleting operations can be considered a transaction, as well as more complex groups of several statements which accomplish a specific task.. This implements a cascaded delete of all detail records of the master record A database row from the master table. The master table is defined by a one-to-many relation to another table (the detail table) being used in the transaction's main operation.
To add a Delete Detail Records trigger A trigger is a SQL procedure that performs an action when a transaction (INSERT, UPDATE, DELETE) occurs. You can use triggers to perform validation of input data, to automatically generate a value for a newly inserted row, to read from other tables for cross-referencing purposes, or to support alerts through e-mail messages. into the page, you must follow the next steps:
The purpose of this user interface tab is to allow the developer set up the delete operation options:
To set the dialog box options, follow the next steps:
In the Transaction table drop-down menu, the table used in the delete/custom transaction on page is automatically selected and the drop-down menu is disabled.
In the Primary key drop-down menu select the table column containing the primary key of the transaction table.
In the Detail table drop-down menu select the table which acts as a detail table for the transaction table. This means that its fields are related to the transaction table through a field.
In the Detail foreign key drop-down menu, select the detail table column that stores the relation to the master table.
The three buttons in the top right corner of the interface offer you the next functionalities:
· Click OK when you are done configuring the trigger.
· Click Cancel to exit without applying the new settings.
· The Help button opens this help page.
These buttons are common to both tabs of the Delete Detail Records
The purpose of this user interface tab is to allow the removal of files that are associated to the detail records. This means that if the master record has entries in the detail table, and those have files attached (e.g. departments -> employees -> employee portrait ) you can set the trigger to also delete the files.
Note: This tab is only available in MX Kollection Professional.
To set the dialog box options, follow the next steps:
In the File folder field enter the name of the base folder where the file to be deleted exists. You can use the Browse button to pick the folder, and it will be added relative to the current page.
In the Table column drop-down menu select one of the table columns that stores the name of the file to remove, or if you have a custom naming, select the None: Rename Rule option.
In the Naming rule text field enter the rule to compute the file name on. You can also add other dynamic or static subfolders, as you can see in the image above. To add dynamic data you can directly enter InterAKT Mark-up, or use the InterAKT Dynamic Data icon to visually select it.
The purpose of this user interface tab is to allow the removal of folders that are associated to the detail records. This means that if the master record has entries in the detail table, and those have folders attached (e.g. departments -> employees -> employee data in a certain folder ) you can set the trigger to also delete the entire folder associated with the detail record.
Note: This tab is only available inMX Kollection Professional.
To set the dialog box options, follow the next steps:
In the Folder(s) grid add rules for folders associated with the detail record that must be deleted. To add a new rule click the Plus (+) button and fill in the options below the grid. To remove a rule select it and then click the Minus (-) button.
In the Folder field enter the name of the base folder where the folder to be deleted exists. You can use the Browse button to pick the folder, and it will be added relative to the current page.
In the Subfolder drop-down menu select one of the transaction fields that gives the name of the folder to remove, or if you have a custom naming, select the None: Rename Rule option.
In the Naming rule text field enter the rule to compute the folder name on. You can also add other dynamic or static subfolders, as you can see in the image above. To add dynamic data you can directly enter InterAKT Mark-up, or use the InterAKT Dynamic Data icon to visually select it.
The purpose of this user interface tab is to allow the developer to change the default trigger properties, to suit the particular situation. All trigger properties (name, type, priority, transactions) can be set from this dialog box:
For instructions on completing this step, see the Advanced tab. For the Delete Detail Records trigger, by default the Priority is set to 99 and the Type is BEFORE, as it should execute before the transaction takes place.
The server behavior added this way can be edited later by double-clicking its name in the Server Behaviors tab of the Application panel.
Related Topics