Minor fixes to pattern pages

This commit is contained in:
Peter Conijn 2023-02-22 10:44:30 +01:00
parent 36e4ad4245
commit 6bb60cb36f
3 changed files with 27 additions and 19 deletions

View file

@ -64,6 +64,9 @@ To achieve this, we are using [access modifiers](https://docs.microsoft.com/bs-c
_The Facade_ _The Facade_
```AL ```AL
/// <summary>
/// Codeunit to extract image information.
/// </summary>
codeunit 3971 Image codeunit 3971 Image
{ {
Access = Public; Access = Public;

View file

@ -53,7 +53,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
var var
IsHandled: Boolean; IsHandled: Boolean;
begin begin
if not ConfirmBlockCustomer(HideDialog) then exit; if not ConfirmBlockCustomer(HideDialog) then
exit;
OnBeforeBlockCustomer(Cust, IsHandled); OnBeforeBlockCustomer(Cust, IsHandled);
DoBlockCustomer(Cust, IsHandled); DoBlockCustomer(Cust, IsHandled);
OnAfterBlockCustomer(Cust); OnAfterBlockCustomer(Cust);
@ -77,7 +78,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
begin begin
DefaultAnswer := true; DefaultAnswer := true;
if HideDialog then exit(DefaultAnswer); if HideDialog then
exit(DefaultAnswer);
exit(ConfirmManagement.GetResponseOrDefault(ConfirmQst, DefaultAnswer)); exit(ConfirmManagement.GetResponseOrDefault(ConfirmQst, DefaultAnswer));
end; end;
@ -85,7 +87,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
var var
AcknowledgeMsg: Label 'You successfully executed "BlockCustomer"'; AcknowledgeMsg: Label 'You successfully executed "BlockCustomer"';
begin begin
if not GuiAllowed or HideDialog then exit; if not GuiAllowed or HideDialog then
exit;
Message(AcknowledgeMsg); Message(AcknowledgeMsg);
end; end;
@ -126,7 +129,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
var var
IsHandled: Boolean; IsHandled: Boolean;
begin begin
if not ConfirmBlockCustomer(HideDialog) then exit; if not ConfirmBlockCustomer(HideDialog) then
exit;
... ...
AcknowledgeBlockCustomer(HideDialog) AcknowledgeBlockCustomer(HideDialog)
end; end;
@ -140,7 +144,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
begin begin
DefaultAnswer := true; DefaultAnswer := true;
if HideDialog then exit(DefaultAnswer); if HideDialog then
exit(DefaultAnswer);
exit(ConfirmManagement.GetResponseOrDefault(ConfirmQst, DefaultAnswer)); exit(ConfirmManagement.GetResponseOrDefault(ConfirmQst, DefaultAnswer));
end; end;
@ -148,7 +153,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
var var
AcknowledgeMsg: Label 'You successfully executed "BlockCustomer"'; AcknowledgeMsg: Label 'You successfully executed "BlockCustomer"';
begin begin
if not GuiAllowed or HideDialog then exit; if not GuiAllowed or HideDialog then
exit;
Message(AcknowledgeMsg); Message(AcknowledgeMsg);
end; end;
... ...

View file

@ -57,16 +57,15 @@ We start with the template
```al ```al
codeunit 50000 ExportTemplate codeunit 50000 ExportTemplate
{ {
procedure ExportData(export: Interface IDataExport) procedure ExportData(Export: Interface IDataExport)
begin begin
if not export.CheckData() then if not Export.CheckData() then
exit; exit;
if export.GetLinesToExport() then begin if Export.GetLinesToExport() then
repeat repeat
export.ExportLine(); Export.ExportLine();
until not export.NextLine(); until not Export.NextLine();
end; Export.Finish();
export.Finish();
end; end;
} }
``` ```
@ -132,13 +131,13 @@ codeunit 50002 ExportOrders
{ {
procedure ExportOrder(DocType: Enum "Sales Document Type"; No: Code[10]) procedure ExportOrder(DocType: Enum "Sales Document Type"; No: Code[10])
var var
export: Codeunit ExportTemplate; Export: Codeunit ExportTemplate;
exportImpl: Codeunit SalesHeaderExport; ExportImpl: Codeunit SalesHeaderExport;
exportInt: Interface IDataExport; ExportInt: Interface IDataExport;
begin begin
exportImpl.SetSalesHeader(DocType, No); ExportImpl.SetSalesHeader(DocType, No);
exportInt := exportImpl; ExportInt := exportImpl;
export.ExportData(exportInt); Export.ExportData(exportInt);
end; end;
} }
``` ```