Create a cleanup rule
Define a rule for deleting records from a primary table on a recurring basis.
Before you begin
Role required: admin
About this task
Create a cleanup rule to delete records on a recurring basis. To delete records as a one-time operation, see Create a one-time delete rule.
Procedure
- Access the create rule wizard in the Data Management Console in one of the following ways.
| Option | Steps |
|---|---|
| Overview tab |
|
| Rules tab |
|
Define the cleanup rule.
On the Define your rule page, select Cleanup as the rule type.
Enter a name and description for the rule.
The name is used as the display value for references to this rule.
Select Save and continue.
Define cleanup rule conditions
Define one or more conditions that identify the records to be deleted.
Before you begin
Role required: admin
About this task
Use the condition builder to specify filter conditions that define the records to be deleted. For example, you might specify that only records where 'active = false AND state =closed' are deleted.
Procedure
On the Define conditions page, select the Date/Time field that you want to use for monitoring duration in the Date field.
Specify the amount of time that the system must wait before deleting records by entering a duration (in years, days, and hours).
Limit the number of records by adding one or more conditions that records must meet.
Select a field, operator, and field value.
For example, [Active] [is] [false].
Use the OR and AND operators to add conditions.
Select Add condition set Criteria to add another set of conditions.
Select Save and continue.
Select associated records to delete
Specify which associated records to delete when the cleanup rule runs.
Before you begin
Role required: admin
Procedure
- On the Clean up associated records page, select which associated records to delete when the cleanup rule runs.
| Associated records | Description |
|---|---|
| Attachments | Selected by default. Associated attachments are always deleted. |
| Journals | If selected, related records in the Journal Entry \[sys\_journal\_field\] table are also deleted.If cleared, the system deletes records from the target table, but not any related journal records in this table. |
| Audits | If selected, related records in the following audit tables are also deleted:- Sys Audit [sys_audit] table - Audit Relationship Change [sys_audit_relation] table Note: Audit records that are created by table cleaner in the Audit Deleted Record [sys_audit_delete] table are preserved. If cleared, the system deletes records from the target table, but not any related audit records in these tables. |
Delete all matching records plus any records referring to them by selecting Cascade delete.
If this option is cleared, the system deletes matching records, but not records referring to them.
Select Save and continue.
View a summary of your cleanup rule and activate it
View a summary of your cleanup rule and decide whether to activate it.
Before you begin
You must activate the cleanup rule and its corresponding data management policy for the cleanup rule to run.
Role required: admin
Procedure
On the Rule summary page, review the cleanup rule conditions and settings.
Activate the rule by selecting Activate the rule upon creation.
Result
The table cleanup rule runs automatically and deletes records when they meet the specified record age and any conditions that you set for them.