diff --git a/content/docs/analyzers/ApplicationCop/AC0005.md b/content/docs/analyzers/ApplicationCop/AC0005.md index e345713..008f595 100644 --- a/content/docs/analyzers/ApplicationCop/AC0005.md +++ b/content/docs/analyzers/ApplicationCop/AC0005.md @@ -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()` and `GlobalLanguage := ` become `TranslationHelper.SetGlobalLanguageById()`. +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 diff --git a/content/docs/analyzers/ApplicationCop/AC0006.md b/content/docs/analyzers/ApplicationCop/AC0006.md index c4ebd03..c048db4 100644 --- a/content/docs/analyzers/ApplicationCop/AC0006.md +++ b/content/docs/analyzers/ApplicationCop/AC0006.md @@ -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