commit
9d49a2dc82
9 changed files with 10 additions and 10 deletions
|
|
@ -12,4 +12,4 @@ weight = 15
|
||||||
This section will be cover things that aren't as simple as Design Patterns, but will help make sure your development is:
|
This section will be cover things that aren't as simple as Design Patterns, but will help make sure your development is:
|
||||||
- high-performance
|
- high-performance
|
||||||
- complies with good designs
|
- complies with good designs
|
||||||
- has high maintability
|
- has high maintainability
|
||||||
|
|
@ -113,7 +113,7 @@ The **pattern** within the codeunit exists of a few layers:
|
||||||
*The UI layer*
|
*The UI layer*
|
||||||
The UI layer takes care of the UI, obviously. What is important in this case, is that you always make sure that there is a "HideDialog" parameter that the business logic can use to still decide whether to use the dialog or not.
|
The UI layer takes care of the UI, obviously. What is important in this case, is that you always make sure that there is a "HideDialog" parameter that the business logic can use to still decide whether to use the dialog or not.
|
||||||
|
|
||||||
These are the UI Layer parts, where you see the public function gets the HideDialog, and passes it to the UI-related procedures, where the business logic for showing the UI takes place. Also, the default answer of the confirmation is handled there as well (what if the businesslogic calls this method with HideDialog to "true").
|
These are the UI Layer parts, where you see the public function gets the HideDialog, and passes it to the UI-related procedures, where the business logic for showing the UI takes place. Also, the default answer of the confirmation is handled there as well (what if the business logic calls this method with HideDialog to "true").
|
||||||
|
|
||||||
```AL
|
```AL
|
||||||
codeunit 53100 "WLD BlockCustomer Meth"
|
codeunit 53100 "WLD BlockCustomer Meth"
|
||||||
|
|
@ -286,7 +286,7 @@ you simply get
|
||||||
```AL
|
```AL
|
||||||
SalesHeader.Post();
|
SalesHeader.Post();
|
||||||
```
|
```
|
||||||
THAT is readabile. The previous is not! That is just something we got used to.
|
THAT is readable. The previous is not! That is just something we got used to.
|
||||||
|
|
||||||
### Testability
|
### Testability
|
||||||
There are two things in terms of testability where this pattern helps a lot.
|
There are two things in terms of testability where this pattern helps a lot.
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ You can read more about Branches here:
|
||||||
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches
|
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches
|
||||||
{{% /notice %}}
|
{{% /notice %}}
|
||||||
### Step 3: Pull Request
|
### Step 3: Pull Request
|
||||||
Once you are happy with your contibution, it's time to create a pull request to propose changes into the main project! This is the final step in producing a fork of someone else's project, and arguably the most important. If you've made a change that you feel would benefit the community as a whole, you should definitely consider contributing back.
|
Once you are happy with your contribution, it's time to create a pull request to propose changes into the main project! This is the final step in producing a fork of someone else's project, and arguably the most important. If you've made a change that you feel would benefit the community as a whole, you should definitely consider contributing back.
|
||||||
|
|
||||||
To do so, head on over to the repository on GitHub where your project lives. For this example, it would be at `https://www.github.com/<your_username>/alguidelines`. You'll see a banner indicating that your branch is one commit ahead of microsoft:main. Click **Contribute** and then **Open a pull request.**
|
To do so, head on over to the repository on GitHub where your project lives. For this example, it would be at `https://www.github.com/<your_username>/alguidelines`. You'll see a banner indicating that your branch is one commit ahead of microsoft:main. Click **Contribute** and then **Open a pull request.**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ Missing, invalid or incomplete data is a common issue during data processing in
|
||||||
|
|
||||||
This article describes how to use the Error Message component in NAV, which in short gives you the possibility to:
|
This article describes how to use the Error Message component in NAV, which in short gives you the possibility to:
|
||||||
|
|
||||||
1\. Link an error mesesage to the page which enables you to resolve the problem.
|
1\. Link an error message to the page which enables you to resolve the problem.
|
||||||
2\. Assemble all error messages in one central view instead of having to encounter them one by one.
|
2\. Assemble all error messages in one central view instead of having to encounter them one by one.
|
||||||
|
|
||||||
Validating data is a common task during data processing in NAV. Unfortunately, validation is often done using NAV's integrated ERROR and TESTFIELD functions, which halt execution of the process. The user will then have to locate the invalid / missing data, correct it and reinitiate the process, possibly running into the next error, making the cycle repeat itself. This can be a very tedious, time-consuming and frustrating process. The error message component aims at improving this experience by providing a lightweight framework for error message logging and this article will explain how to leverage this functionality in your code. By doing so, all error messages are gathered during (pre-)processing and are finally presented to the user. The user then has the possibility to click on the error message, which will open the record where the invalid / missing data is located, thereby enabling the user to correct all mistakes efficiently, from one central place and in one go.
|
Validating data is a common task during data processing in NAV. Unfortunately, validation is often done using NAV's integrated ERROR and TESTFIELD functions, which halt execution of the process. The user will then have to locate the invalid / missing data, correct it and reinitiate the process, possibly running into the next error, making the cycle repeat itself. This can be a very tedious, time-consuming and frustrating process. The error message component aims at improving this experience by providing a lightweight framework for error message logging and this article will explain how to leverage this functionality in your code. By doing so, all error messages are gathered during (pre-)processing and are finally presented to the user. The user then has the possibility to click on the error message, which will open the record where the invalid / missing data is located, thereby enabling the user to correct all mistakes efficiently, from one central place and in one go.
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ To format headlines, you should use Codeunit 1439 Headline Management functions:
|
||||||
EssentialBusinessHeadline."Headline Name"::SalesIncrease,
|
EssentialBusinessHeadline."Headline Name"::SalesIncrease,
|
||||||
EssentialBusinessHeadline."Headline Name"::TopCustomer);
|
EssentialBusinessHeadline."Headline Name"::TopCustomer);
|
||||||
AtLeastOneHeadlineVisible := not EssentialBusinessHeadline.IsEmpty();
|
AtLeastOneHeadlineVisible := not EssentialBusinessHeadline.IsEmpty();
|
||||||
// only modify the var if this extension is making some headlines visible, setting to false could overrride some other extensions setting the value to true
|
// only modify the var if this extension is making some headlines visible, setting to false could override some other extensions setting the value to true
|
||||||
if AtLeastOneHeadlineVisible then
|
if AtLeastOneHeadlineVisible then
|
||||||
ExtensionHeadlinesVisible := true;
|
ExtensionHeadlinesVisible := true;
|
||||||
end;
|
end;
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ Step 4: implement the business logic, by calling out to a new function. And impl
|
||||||
|
|
||||||
## Consequences
|
## Consequences
|
||||||
|
|
||||||
This pattern can be used in all cases to put busines logic. But I see three possible approaches
|
This pattern can be used in all cases to put business logic. But I see three possible approaches
|
||||||
|
|
||||||
1. You only declare the most important and most used hooks
|
1. You only declare the most important and most used hooks
|
||||||
* This way, you limit the amount of objects and hooks to only a few in the default product
|
* This way, you limit the amount of objects and hooks to only a few in the default product
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ Table 15 G/L Account, Page 17 G/L Account Card & Page 18 G/L Account List
|
||||||
|
|
||||||
Table 27: Item, Page 30 Item Card & Page 31 Item List
|
Table 27: Item, Page 30 Item Card & Page 31 Item List
|
||||||
|
|
||||||
Table 156: Resouce, Page 76 Resource Card & Page 77 Resource List
|
Table 156: Resource, Page 76 Resource Card & Page 77 Resource List
|
||||||
|
|
||||||
Table 5600: Fixed Asset, Page 5600 Fixed Asset Card & Page 5601 Fixed Asset List
|
Table 5600: Fixed Asset, Page 5600 Fixed Asset Card & Page 5601 Fixed Asset List
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ The pattern depends on .NET library System.IO.Compression.ZipFile, which from NA
|
||||||
|
|
||||||
* CreateZipArchiveObject: Which creates a System.IO.Compression.ZipArchive on a server side file
|
* CreateZipArchiveObject: Which creates a System.IO.Compression.ZipArchive on a server side file
|
||||||
* AddFileToZipArchive: Which adds a server side file to the archive using System.IO.Compression.ZipFileExtensions.CreateEntryFromFile(). This function allows to use arbitrary naming and does not require to create a server directory before creating the ZIP achieve.
|
* AddFileToZipArchive: Which adds a server side file to the archive using System.IO.Compression.ZipFileExtensions.CreateEntryFromFile(). This function allows to use arbitrary naming and does not require to create a server directory before creating the ZIP achieve.
|
||||||
* CloseZipArhive: Which simply closes the ZIP file and saves it to disk.
|
* CloseZipArchive: Which simply closes the ZIP file and saves it to disk.
|
||||||
|
|
||||||
The pattern is integrated into the report/codeunit in question by providing a filename field on the request page if it is on WinClient but hidden if it is in Web client. On the Web client, a meaningful default filename is used for the file to download, e.g. in Code 1, Filename is set by the user on the request page if it is WinClient, and set to a default value in Web client.
|
The pattern is integrated into the report/codeunit in question by providing a filename field on the request page if it is on WinClient but hidden if it is in Web client. On the Web client, a meaningful default filename is used for the file to download, e.g. in Code 1, Filename is set by the user on the request page if it is WinClient, and set to a default value in Web client.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,7 @@ Setup table would contain the list of the reports and their usages. Based on Tab
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
ReportSelectionSetup.SETRANGE("Table ID", RecordRef.NUBMER);
|
ReportSelectionSetup.SETRANGE("Table ID", RecordRef.NUMBER);
|
||||||
|
|
||||||
ReportSelectionSetup.SETRANGE("Usage Type", RecordRef.FieldValue(ArgumentTable."Usage Type");
|
ReportSelectionSetup.SETRANGE("Usage Type", RecordRef.FieldValue(ArgumentTable."Usage Type");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue