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:
- 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. - Return whether the module accepted the registration:
trueon success, and stilltruewhen the table was already registered — setup code gets rerun.
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.
Already on Pro? Sign in