From 1276c3f783a651cbc3d64ce7936cc3d4af773979 Mon Sep 17 00:00:00 2001 From: Blanca Robledo Diaz Date: Wed, 25 Sep 2024 14:56:46 +0200 Subject: [PATCH 1/4] Fix get app id for system application objects --- .../src/VsCodeIntegrationImpl.Codeunit.al | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al b/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al index b58dfac367..2408a3fa35 100644 --- a/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al +++ b/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al @@ -119,8 +119,13 @@ codeunit 8333 "VS Code Integration Impl." [Scope('OnPrem')] local procedure GetAppIdForObject(ObjectType: Option; ObjectId: Integer): Text var - NavAppInstalledApp: Record "NAV App Installed App"; + NavAppInstalledApp: Record; + EmptyGuid: Guid; begin + // Objects in the system app range + if ObjectId >= '2000000000' then + exit(EmptyGuid); + if AllObjWithCaption.ReadPermission() then begin AllObjWithCaption.Reset(); AllObjWithCaption.SetRange("Object Type", ObjectType); From c38af3b8e8f354ce434b77e1b324429ccf13f0d1 Mon Sep 17 00:00:00 2001 From: Blanca Robledo Diaz Date: Wed, 25 Sep 2024 14:59:29 +0200 Subject: [PATCH 2/4] fix --- .../VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al b/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al index 2408a3fa35..45f8817aa3 100644 --- a/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al +++ b/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al @@ -119,7 +119,7 @@ codeunit 8333 "VS Code Integration Impl." [Scope('OnPrem')] local procedure GetAppIdForObject(ObjectType: Option; ObjectId: Integer): Text var - NavAppInstalledApp: Record; + NavAppInstalledApp: Record "NAV App Installed App"; EmptyGuid: Guid; begin // Objects in the system app range From 8f9ffeb1c44cbe8705f6fac869e1c90157b203b8 Mon Sep 17 00:00:00 2001 From: Blanca Robledo Diaz Date: Wed, 25 Sep 2024 15:00:04 +0200 Subject: [PATCH 3/4] fix --- .../VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al b/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al index 45f8817aa3..b3f4ca2e08 100644 --- a/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al +++ b/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al @@ -123,7 +123,7 @@ codeunit 8333 "VS Code Integration Impl." EmptyGuid: Guid; begin // Objects in the system app range - if ObjectId >= '2000000000' then + if ObjectId >= 2000000000 then exit(EmptyGuid); if AllObjWithCaption.ReadPermission() then begin From 7a75f0e6bbbff261dc1c436e0d616e24fe247df8 Mon Sep 17 00:00:00 2001 From: Blanca Robledo Diaz Date: Wed, 25 Sep 2024 15:25:20 +0200 Subject: [PATCH 4/4] code review suggestion --- .../src/VsCodeIntegrationImpl.Codeunit.al | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al b/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al index b3f4ca2e08..2e823da21c 100644 --- a/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al +++ b/src/System Application/App/VS Code Integration/src/VsCodeIntegrationImpl.Codeunit.al @@ -11,7 +11,6 @@ codeunit 8333 "VS Code Integration Impl." InherentPermissions = X; var - AllObjWithCaption: Record AllObjWithCaption; UriBuilder: Codeunit "Uri Builder"; VSCodeRequestHelper: DotNet VSCodeRequestHelper; AlExtensionUriTxt: Label 'vscode://ms-dynamics-smb.al', Locked = true; @@ -105,6 +104,8 @@ codeunit 8333 "VS Code Integration Impl." [Scope('OnPrem')] local procedure FormatObjectType(ObjectType: Option): Text + var + AllObjWithCaption: Record AllObjWithCaption; begin case ObjectType of AllObjWithCaption."Object Type"::Page: @@ -119,6 +120,7 @@ codeunit 8333 "VS Code Integration Impl." [Scope('OnPrem')] local procedure GetAppIdForObject(ObjectType: Option; ObjectId: Integer): Text var + AllObjWithCaption: Record AllObjWithCaption; NavAppInstalledApp: Record "NAV App Installed App"; EmptyGuid: Guid; begin @@ -127,7 +129,6 @@ codeunit 8333 "VS Code Integration Impl." exit(EmptyGuid); if AllObjWithCaption.ReadPermission() then begin - AllObjWithCaption.Reset(); AllObjWithCaption.SetRange("Object Type", ObjectType); AllObjWithCaption.SetRange("Object ID", ObjectId);