5030

Registered for Cleanup

retention-policy
data-administration
allowed-tables
system-application

Registered for Cleanup

Every integration call your company processes drops a row into a custom audit log, and nobody ever deletes them — the table is on its way to becoming the biggest one in the database. Business Central ships a Retention Policy module for exactly this: an extension registers its table as cleanup-capable, an admin picks a retention period, and a scheduled run deletes what has expired — leaving a paper trail in the Retention Policy Log. Your job is to wire the audit log into that machinery instead of hand-rolling yet another delete-loop job.

The starter ships the finished table "Transaction Audit Log" — primary key "Entry No." (Integer), plus "Logged Date" (Date) and Description (Text[100]). Do not rename the table or its fields — the grading tests bind to every name below character for character.

Requirements

Implement the three procedures of codeunit "Audit Log Retention":

procedure RegisterAuditLog(): Boolean
procedure CreatePolicy(PeriodCode: Code[20]; Period: Enum "Retention Period Enum")
procedure RunCleanup()

RegisterAuditLog — make the table cleanup-capable:

  1. Register "Transaction Audit Log" with the retention policy module so an admin may cover it with a retention policy, with "Logged Date" as its default date field — rows must age by when they were logged, not by a system timestamp.
  2. Return whether the module accepted the registration: true on success, and still true when the table was already registered — setup code gets rerun.
The rest of the statement and 3 hints Unlock with Pro
ALBusiness Central 28.5
Pro
Pro problem

Solve it with Pro

You’re reading the opening of the statement. Pro unlocks the whole problem:

  • The full statement
  • Starter code in the browser editor
  • 10 grading tests, run on Business Central 28.5
  • 3 hints
  • The reference solution

Pro also opens all 92 Pro problems and lifts the daily limits on compile checks and submissions.

$10 / month
or $100 / year
Upgrade
This problem is part of Pro
Pro unlocks the full statement, tests, hints and solution. The code editor works on a computer.
Upgrade