5087

Reminder Levels, By the Book

Algorithm
Hard
Pro
reminders
receivables
escalation
fees

Reminder Levels, By the Book

The collections add-on your client bought escalates reminders by counting its own runs: every execution of the batch bumps every customer one level, whether or not anything was ever issued, and a payment reminder for an invoice that is 3 days late can arrive with a third-level threat and a fee to match. You are rebuilding the Create Reminders decision logic the way Business Central's own reminder terms define it: the level lives on the entries, one grace period per level, a cap on how far the ladder goes, and three ways to charge the fee.

What you are given

The starter contains three finished objects — submit them unchanged alongside your codeunit:

  • Table "Escalation Entry" — one row per open customer ledger entry: field 1 "Entry No." (Integer, PK), field 2 "Due Date" (Date), field 3 "Remaining Amount" (Decimal), field 4 "On Hold" (Boolean), field 5 "Last Issued Reminder Level" (Integer, 0 = never reminded), plus two result fields you fill in: field 10 "Included on Reminder" (Boolean) and field 11 "New Reminder Level" (Integer).
  • Table "Escalation Level" — the reminder ladder: field 1 "Level No." (Integer, PK), field 2 "Grace Period Days" (Integer), field 3 "Additional Fee" (Decimal), field 4 "Fee %" (Decimal).
  • Enum "Escalation Fee Method" — Fixed, "Single Dynamic", "Accumulated Dynamic".

Requirements

Create a codeunit named "Reminder Escalation" with one public procedure, exactly as written:

procedure SuggestReminder(var EscalationEntry: Record "Escalation Entry"; MaxNoOfReminders: Integer; FeeMethod: Enum "Escalation Fee Method"; AsOfDate: Date; var FeeAmount: Decimal): Integer

The tests seed the "Escalation Level" table, fill a temporary "Escalation Entry" record with one customer's open entries, and call your procedure. It returns the reminder level (0 when no reminder is created), sets FeeAmount, and writes the two result fields back on every entry in the buffer it received.

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
  • 14 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