bcquality/microsoft/knowledge/breaking-changes/do-not-modify-code-already-marked-obsolete.bad.al
Jesper Schulz-Wedde 6140a52b03
Add breaking-changes knowledge domain and review leaf skill (#44)
Seed a new breaking-changes (AL API stability) knowledge domain with six
articles plus good/bad AL samples, a new al-breaking-changes-review leaf
skill, and minimal wiring into al-code-review and the README.

Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-25 12:33:30 +02:00

22 lines
640 B
AL

codeunit 50316 "Pricing Api Bad"
{
// Anti-pattern: new surcharge logic is added inside a procedure already marked
// obsolete, and inside a #if not CLEAN25 block. Both are scheduled for removal,
// so this behaviour disappears the moment CLEAN25 is enabled.
[Obsolete('Use GetUnitPrice instead.', '25.0')]
procedure GetPrice(ItemNo: Code[20]): Decimal
var
Price: Decimal;
begin
Price := 100;
#if not CLEAN25
Price += CalculateSurcharge(ItemNo);
#endif
exit(Price);
end;
local procedure CalculateSurcharge(ItemNo: Code[20]): Decimal
begin
exit(5);
end;
}