LC0021 - StefanMaron/BusinessCentral.LinterCop GitHub Wiki
Confirm()
must be implemented through the Confirm Management
codeunit from the System Application.
LC0021 - There are multiple benefits for implementing a Confirm() through the Confirm Management codeunit;
- Automatical validation for IsGuiAllowed()
- Help the user with setting a default response button (true/false)
Source: https://github.com/microsoft/BCApps/tree/main/src/System%20Application/App/Confirm%20Management
Example
Calling the Confirm() function directly
if Confirm(AreYouSureQst) then
DoSomething();
Calling the Confirm() function through the Confirm Management codeunit
var
ConfirmManagement: Codeunit "Confirm Management";
DefaultAnswer: boolean;
DefaultAnswer := false;
if ConfirmManagement.GetResponseOrDefault(AreYouSureQst, DefaultAnswer) then
DoSomething();
More on the why
There's great content out there on this particular topic, some examples