From db413c7a469af08a5d0fd4383f0940f8bdb13232 Mon Sep 17 00:00:00 2001 From: Jesper Schulz-Wedde Date: Fri, 29 Nov 2024 16:52:33 +0100 Subject: [PATCH 1/2] Calculate fields again after drill down. --- .../App/Word Templates/src/WordTemplatesRelatedPart.Page.al | 1 + 1 file changed, 1 insertion(+) diff --git a/src/System Application/App/Word Templates/src/WordTemplatesRelatedPart.Page.al b/src/System Application/App/Word Templates/src/WordTemplatesRelatedPart.Page.al index e729c065de..fd315958dd 100644 --- a/src/System Application/App/Word Templates/src/WordTemplatesRelatedPart.Page.al +++ b/src/System Application/App/Word Templates/src/WordTemplatesRelatedPart.Page.al @@ -73,6 +73,7 @@ page 9987 "Word Templates Related Part" WordTemplateFieldSelection.ShowFieldSelection(Rec."Related Table ID", TempWordTemplateField); NumberOfSelectedFields := WordTemplateFieldSelection.CalculateNoSelectedFields(Rec."Related Table ID", TempWordTemplateField); SelectedFieldsCount.Set(Rec."Related Table ID", NumberOfSelectedFields); + CalculateSelectedFields(); end; } field("Entity Relation"; RecordTypeTxt) From c1d35f53e7fa15801dbce843e5d530f0329fd4c5 Mon Sep 17 00:00:00 2001 From: Jesper Schulz-Wedde Date: Fri, 29 Nov 2024 18:56:50 +0100 Subject: [PATCH 2/2] Remove fields from global variable upon deletion of row. --- .../App/Word Templates/src/WordTemplatesRelatedPart.Page.al | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/System Application/App/Word Templates/src/WordTemplatesRelatedPart.Page.al b/src/System Application/App/Word Templates/src/WordTemplatesRelatedPart.Page.al index fd315958dd..61ab7259f3 100644 --- a/src/System Application/App/Word Templates/src/WordTemplatesRelatedPart.Page.al +++ b/src/System Application/App/Word Templates/src/WordTemplatesRelatedPart.Page.al @@ -73,7 +73,6 @@ page 9987 "Word Templates Related Part" WordTemplateFieldSelection.ShowFieldSelection(Rec."Related Table ID", TempWordTemplateField); NumberOfSelectedFields := WordTemplateFieldSelection.CalculateNoSelectedFields(Rec."Related Table ID", TempWordTemplateField); SelectedFieldsCount.Set(Rec."Related Table ID", NumberOfSelectedFields); - CalculateSelectedFields(); end; } field("Entity Relation"; RecordTypeTxt) @@ -200,6 +199,8 @@ page 9987 "Word Templates Related Part" TempWordTemplateField.Reset(); TempWordTemplateField.SetRange("Table ID", Rec."Related Table ID"); TempWordTemplateField.DeleteAll(); + + SelectedFieldsCount.Remove(Rec."Related Table ID"); end; internal procedure AddRelatedTable(TableId: Integer)