Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions content/docs/analyzers/ApplicationCop/AC0005.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ The code fix replaces individual `GlobalLanguage()` calls with the corresponding
- `GlobalLanguage(1033)` becomes `TranslationHelper.SetGlobalLanguageToDefault()`, since `1033` is the default application language.
- `GlobalLanguage(<other id>)` and `GlobalLanguage := <id>` become `TranslationHelper.SetGlobalLanguageById(<id>)`.

The fix declares a local `TranslationHelper` variable, unless the procedure or object already has a `Codeunit "Translation Helper"` variable. When the file declares a namespace, it also adds `using System.IO;`. The namespace is taken from the Translation Helper codeunit in the project's dependencies, and the `using` is inserted alphabetically among the existing ones. It is skipped when the namespace is already imported or when the file itself is in that namespace.

### See also

- [Codeunit "Translation Helper"](https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/system.io.translation-helper) on Microsoft Learn
Expand Down
2 changes: 2 additions & 0 deletions content/docs/analyzers/ApplicationCop/AC0006.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ The code fix replaces `Page.Run` and `Page.RunModal` calls with the correspondin
- `Page.RunModal(Page::X, Record)` becomes `PageManagement.PageRunModal(Record)`.
- When a field parameter is present, `Page.Run(Page::X, Record, FieldNo)` becomes `PageManagement.PageRunAtField(Record, FieldNo, false)` and the modal variant uses `true` for the third parameter.

The fix declares a local `PageManagement` variable, unless the procedure or object already has a `Codeunit "Page Management"` variable. When the file declares a namespace, it also adds `using Microsoft.Utilities;`. The namespace is taken from the Page Management codeunit in the project's dependencies, and the `using` is inserted alphabetically among the existing ones. It is skipped when the namespace is already imported or when the file itself is in that namespace.

### See also

- [Codeunit "Page Management"](https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.utilities.page-management) on Microsoft Learn
Expand Down
Loading