From 6bb60cb36f6bc7ba6db135250e35cf70da80424b Mon Sep 17 00:00:00 2001
From: Peter Conijn
Date: Wed, 22 Feb 2023 10:44:30 +0100
Subject: [PATCH] Minor fixes to pattern pages
---
content/docs/patterns/facade-pattern/index.md | 3 +++
.../patterns/generic-method-pattern/index.md | 18 ++++++++-----
.../patterns/template-method-pattern/index.md | 25 +++++++++----------
3 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/content/docs/patterns/facade-pattern/index.md b/content/docs/patterns/facade-pattern/index.md
index d9e447579..965a4adb1 100644
--- a/content/docs/patterns/facade-pattern/index.md
+++ b/content/docs/patterns/facade-pattern/index.md
@@ -64,6 +64,9 @@ To achieve this, we are using [access modifiers](https://docs.microsoft.com/bs-c
_The Facade_
```AL
+///
+/// Codeunit to extract image information.
+///
codeunit 3971 Image
{
Access = Public;
diff --git a/content/docs/patterns/generic-method-pattern/index.md b/content/docs/patterns/generic-method-pattern/index.md
index f5ad97698..db8808921 100644
--- a/content/docs/patterns/generic-method-pattern/index.md
+++ b/content/docs/patterns/generic-method-pattern/index.md
@@ -53,7 +53,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
var
IsHandled: Boolean;
begin
- if not ConfirmBlockCustomer(HideDialog) then exit;
+ if not ConfirmBlockCustomer(HideDialog) then
+ exit;
OnBeforeBlockCustomer(Cust, IsHandled);
DoBlockCustomer(Cust, IsHandled);
OnAfterBlockCustomer(Cust);
@@ -77,7 +78,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
begin
DefaultAnswer := true;
- if HideDialog then exit(DefaultAnswer);
+ if HideDialog then
+ exit(DefaultAnswer);
exit(ConfirmManagement.GetResponseOrDefault(ConfirmQst, DefaultAnswer));
end;
@@ -85,7 +87,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
var
AcknowledgeMsg: Label 'You successfully executed "BlockCustomer"';
begin
- if not GuiAllowed or HideDialog then exit;
+ if not GuiAllowed or HideDialog then
+ exit;
Message(AcknowledgeMsg);
end;
@@ -126,7 +129,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
var
IsHandled: Boolean;
begin
- if not ConfirmBlockCustomer(HideDialog) then exit;
+ if not ConfirmBlockCustomer(HideDialog) then
+ exit;
...
AcknowledgeBlockCustomer(HideDialog)
end;
@@ -140,7 +144,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
begin
DefaultAnswer := true;
- if HideDialog then exit(DefaultAnswer);
+ if HideDialog then
+ exit(DefaultAnswer);
exit(ConfirmManagement.GetResponseOrDefault(ConfirmQst, DefaultAnswer));
end;
@@ -148,7 +153,8 @@ codeunit 53100 "WLD BlockCustomer Meth"
var
AcknowledgeMsg: Label 'You successfully executed "BlockCustomer"';
begin
- if not GuiAllowed or HideDialog then exit;
+ if not GuiAllowed or HideDialog then
+ exit;
Message(AcknowledgeMsg);
end;
...
diff --git a/content/docs/patterns/template-method-pattern/index.md b/content/docs/patterns/template-method-pattern/index.md
index 5465efec1..81eab9c36 100644
--- a/content/docs/patterns/template-method-pattern/index.md
+++ b/content/docs/patterns/template-method-pattern/index.md
@@ -57,16 +57,15 @@ We start with the template
```al
codeunit 50000 ExportTemplate
{
- procedure ExportData(export: Interface IDataExport)
+ procedure ExportData(Export: Interface IDataExport)
begin
- if not export.CheckData() then
+ if not Export.CheckData() then
exit;
- if export.GetLinesToExport() then begin
+ if Export.GetLinesToExport() then
repeat
- export.ExportLine();
- until not export.NextLine();
- end;
- export.Finish();
+ Export.ExportLine();
+ until not Export.NextLine();
+ Export.Finish();
end;
}
```
@@ -132,13 +131,13 @@ codeunit 50002 ExportOrders
{
procedure ExportOrder(DocType: Enum "Sales Document Type"; No: Code[10])
var
- export: Codeunit ExportTemplate;
- exportImpl: Codeunit SalesHeaderExport;
- exportInt: Interface IDataExport;
+ Export: Codeunit ExportTemplate;
+ ExportImpl: Codeunit SalesHeaderExport;
+ ExportInt: Interface IDataExport;
begin
- exportImpl.SetSalesHeader(DocType, No);
- exportInt := exportImpl;
- export.ExportData(exportInt);
+ ExportImpl.SetSalesHeader(DocType, No);
+ ExportInt := exportImpl;
+ Export.ExportData(exportInt);
end;
}
```