diff --git a/src/System Application/App/Table Information/src/IndexDetails.page.al b/src/System Application/App/Table Information/src/IndexDetails.page.al new file mode 100644 index 0000000000..faab8dbba4 --- /dev/null +++ b/src/System Application/App/Table Information/src/IndexDetails.page.al @@ -0,0 +1,46 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ + +namespace System.DataAdministration; + +using System.Diagnostics; + +/// +/// Displays additional details for a specific index. +/// +page 9705 "Index Details" +{ + Caption = 'Index Details'; + + PageType = CardPart; + ApplicationArea = All; + UsageCategory = Administration; + SourceTable = "Database Index"; + Permissions = tabledata "Database Index" = r; + + layout + { + area(Content) + { + group(Fields) + { + Caption = 'Key Fields'; + + field(FieldNames; Rec."Column Names") + { + Caption = 'Fields in Index'; + ToolTip = 'Specifies the fields that are part of this index.'; + MultiLine = true; + } + field("Included Fields"; Rec."Included Fields") + { + Caption = 'Included Fields'; + ToolTip = 'Specifies the fields that are included in this index but not part of the key.'; + MultiLine = true; + } + } + } + } +} diff --git a/src/System Application/App/Table Information/src/IndexesListPart.Page.al b/src/System Application/App/Table Information/src/IndexesListPart.Page.al index f642e34758..41daae2475 100644 --- a/src/System Application/App/Table Information/src/IndexesListPart.Page.al +++ b/src/System Application/App/Table Information/src/IndexesListPart.Page.al @@ -133,8 +133,11 @@ page 8704 "Indexes List Part" var IndexManagement: Codeunit "Index Management"; RecordIDOfCurrentPosition: RecordId; + IsMetadataDefined: Boolean; begin - if not Rec."Metadata Defined" then + IsMetadataDefined := Rec."Metadata Defined"; + + if not IsMetadataDefined then if not Dialog.Confirm(TurnOffIndexWarningQst) then exit; @@ -144,7 +147,9 @@ page 8704 "Indexes List Part" Rec.DeleteAll(); // Clear the temporary table to make sure the disabled index is not shown. BuildInMemoryList(Rec.TableId); // Rebuild the in-memory list to get the updated index status. - Rec.Get(RecordIDOfCurrentPosition); // Return to the same position in the list after refreshing the data. + + if IsMetadataDefined then + if Rec.Get(RecordIDOfCurrentPosition) then; // Done to avoid throwing an error, returning to the right position is of secondary importance. CurrPage.Update(false); end; @@ -162,8 +167,11 @@ page 8704 "Indexes List Part" DatabaseIndex: Record "Database Index"; IndexManagement: Codeunit "Index Management"; RecordIDOfCurrentPosition: RecordId; + IsMetadataDefined: Boolean; begin - if not Rec."Metadata Defined" then + IsMetadataDefined := Rec."Metadata Defined"; + + if not IsMetadataDefined then if not Dialog.Confirm(TurnOffIndexWarningQst) then exit; @@ -177,7 +185,9 @@ page 8704 "Indexes List Part" Rec.DeleteAll(); // Clear the temporary table to make sure the disabled index is not shown. BuildInMemoryList(Rec.TableId); // Rebuild the in-memory list to get the updated index status. - Rec.Get(RecordIDOfCurrentPosition); // Return to the same position in the list after refreshing the data. + + if IsMetadataDefined then + if Rec.Get(RecordIDOfCurrentPosition) then; // Done to avoid throwing an error, returning to the right position is of secondary importance. CurrPage.Update(false); end; @@ -189,6 +199,7 @@ page 8704 "Indexes List Part" Image = Add; ToolTip = 'Enqueues the index to be turned on in the subsequent maintenance window.'; + trigger OnAction() var KeyRec: Record "Key"; diff --git a/src/System Application/App/Table Information/src/TableInformationCard.Page.al b/src/System Application/App/Table Information/src/TableInformationCard.Page.al index d3cb524e3b..3dbffb0ff3 100644 --- a/src/System Application/App/Table Information/src/TableInformationCard.Page.al +++ b/src/System Application/App/Table Information/src/TableInformationCard.Page.al @@ -73,11 +73,18 @@ page 8705 "Table Information Card" ToolTip = 'Specifies the last time the database engine was started. Index statistics are reset when SQL Server is restarted.'; } } - part(IndexLines; "Indexes List Part") { SubPageLink = TableId = field(ID); } + part(IndexDetails; "Index Details") + { + Provider = IndexLines; + SubPageLink = TableId = field(TableId), + "Company Name" = field("Company Name"), + "Source App ID" = field("Source App ID"), + "Index Name" = field("Index Name"); + } } }