Create a cleanup rule

  • Versão de lançamento: Australia
  • Atualizado 12 de mar. de 2026
  • 2 min. de leitura
  • Define a rule for deleting records from a primary table on a recurring basis.

    Antes de Iniciar

    Role required: admin

    Por Que e Quando Desempenhar Esta Tarefa

    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.

    Procedimento

    1. Access the create rule wizard in the Data Management Console in one of the following ways.
      OptionSteps
      Overview tab
      1. Navigate to All > System Data Management > Data Management Console > .
      2. On the Overview tab, select the table with records that you want to clean up.
      3. Select Create rule.
      Rules tab
      1. Navigate to All > System Data Management > Data Management Console > .
      2. On the Tables tab, select the table with records that you want to clean up.
      3. On the table details page, select the Rules tab.
      4. Select Create rule.
    2. Define the cleanup rule.
      1. On the Define your rule page, select Cleanup as the rule type.
      2. Enter a name and description for the rule.
        The name is used as the display value for references to this rule.
      3. Select Save and continue.

    Define cleanup rule conditions

    Define one or more conditions that identify the records to be deleted.

    Antes de Iniciar

    Role required: admin

    Por Que e Quando Desempenhar Esta Tarefa

    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.

    Procedimento

    1. On the Define conditions page, select the Date/Time field that you want to use for monitoring duration in the Date field.
    2. Specify the amount of time that the system must wait before deleting records by entering a duration (in years, days, and hours).
    3. Limit the number of records by adding one or more conditions that records must meet.
      1. Select a field, operator, and field value.
        For example, [Active] [is] [false].
      2. Opcional: Use the OR and AND operators to add conditions.
      3. Opcional: Select Add condition set Criteria to add another set of conditions.
    4. Select Save and continue.

    Select associated records to delete

    Specify which associated records to delete when the cleanup rule runs.

    Antes de Iniciar

    Role required: admin

    Procedimento

    1. On the Clean up associated records page, select which associated records to delete when the cleanup rule runs.
      Associated recordsDescription
      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
      Nota:
      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.

    2. Opcional: 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.
    3. 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.

    Antes de Iniciar

    You must activate the cleanup rule and its corresponding data management policy for the cleanup rule to run.

    Role required: admin

    Procedimento

    1. On the Rule summary page, review the cleanup rule conditions and settings.
    2. Opcional: Activate the rule by selecting Activate the rule upon creation.

    Resultado

    The table cleanup rule runs automatically and deletes records when they meet the specified record age and any conditions that you set for them.