-
Notifications
You must be signed in to change notification settings - Fork 31
LC0021
Arthur edited this page Dec 8, 2023
·
5 revisions
LC0021 - Confirm()
must be implemented through the Confirm Management
codeunit from the System Application.
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
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();
There's great content out there on this particular topic, some examples