Run the Data Fix Exactly Once
Version 1 of your loyalty extension had a bug: it never granted the one-time 100-point signup bonus, so every member recruited under v1 is 100 points short. Version 2 ships a data-fix routine that grants those points retroactively — and a routine like that is dangerous: run it twice and every member is overpaid, run it in a brand-new company and it "fixes" data that was never broken. Business Central's answer is the upgrade-tag pattern from the System Application: the fix marks the company once it has run, checks the mark before running, and fresh companies are born with the mark already set.
One platform note: grading cannot trigger a real extension upgrade, so you write the fix as a plain public procedure that the tests call directly — in production the same body would sit behind an upgrade codeunit's OnUpgradePerCompany trigger.
Requirements
The starter ships the "Loyalty Member" table ("No.", Name, Points) — do not change it; the tests rely on it exactly as given. Your work is the codeunit named "Loyalty Data Fix" with these two public procedures:
procedure GrantMissingSignupBonus()
procedure GetSignupBonusUpgradeTag(): Code[250]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
- 6 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