From 8728f3ed182467bb7635dd6638eabc6ec641f3f7 Mon Sep 17 00:00:00 2001 From: Nikola Kukrika Date: Tue, 17 Sep 2024 21:01:08 +0200 Subject: [PATCH 1/2] Fixing the telemetry reporting --- .../src/PageSummaryProviderImpl.Codeunit.al | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System Application/App/Page Summary Provider/src/PageSummaryProviderImpl.Codeunit.al b/src/System Application/App/Page Summary Provider/src/PageSummaryProviderImpl.Codeunit.al index 22d8f261f7..fc64523c02 100644 --- a/src/System Application/App/Page Summary Provider/src/PageSummaryProviderImpl.Codeunit.al +++ b/src/System Application/App/Page Summary Provider/src/PageSummaryProviderImpl.Codeunit.al @@ -200,7 +200,7 @@ codeunit 2717 "Page Summary Provider Impl." local procedure GetRecordFields(PageId: Integer; Bookmark: Text; var ResultJsonObject: JsonObject) begin // Get all visible and available table fields that back the controls that are visible on the page - if TryGetAvailableRecordFieldsData(PageId, Bookmark, ResultJsonObject) then + if not TryGetAvailableRecordFieldsData(PageId, Bookmark, ResultJsonObject) then Session.LogMessage('0000NFZ', StrSubstNo(GetRecordFieldsFailureTelemetryTxt, PageId), Verbosity::Error, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', PageSummaryCategoryLbl); exit; end; From 2754eb72210b92aab7d6c8007f2c1c1f14557dc2 Mon Sep 17 00:00:00 2001 From: Nikola Kukrika Date: Tue, 17 Sep 2024 21:24:13 +0200 Subject: [PATCH 2/2] Fixing telemetry --- .../src/PageSummaryProviderImpl.Codeunit.al | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/System Application/App/Page Summary Provider/src/PageSummaryProviderImpl.Codeunit.al b/src/System Application/App/Page Summary Provider/src/PageSummaryProviderImpl.Codeunit.al index fc64523c02..54ee1e6536 100644 --- a/src/System Application/App/Page Summary Provider/src/PageSummaryProviderImpl.Codeunit.al +++ b/src/System Application/App/Page Summary Provider/src/PageSummaryProviderImpl.Codeunit.al @@ -32,9 +32,6 @@ codeunit 2717 "Page Summary Provider Impl." procedure GetPageSummary(PageSummaryParameters: Record "Page Summary Parameters"): Text begin - if PageSummaryParameters."Page ID" = 0 then - ThrowPageMustBeSpecifiedError(); - if PageSummaryParameters.Bookmark <> '' then exit(GetPageSummary(PageSummaryParameters."Page ID", PageSummaryParameters.Bookmark, PageSummaryParameters."Include Binary Data")); @@ -149,10 +146,8 @@ codeunit 2717 "Page Summary Provider Impl." Clear(PageSummarySettings); PageSummaryJsonObject.ReadFrom(JsonText); - if not PageSummaryJsonObject.Get(PageIDTok, ParsedJsonToken) then - ThrowPageMustBeSpecifiedError(); - - PageSummaryParameters."Page ID" := ParsedJsonToken.AsValue().AsInteger(); + if PageSummaryJsonObject.Get(PageIDTok, ParsedJsonToken) then + PageSummaryParameters."Page ID" := ParsedJsonToken.AsValue().AsInteger(); if PageSummaryJsonObject.Get(BookmarkTok, ParsedJsonToken) then #pragma warning disable AA0139 @@ -441,16 +436,6 @@ codeunit 2717 "Page Summary Provider Impl." ExtractPictureFromMedia(TenantMediaSet."Media ID".MediaId, FieldValue, MimeType, FieldType); end; - local procedure ThrowPageMustBeSpecifiedError() - var - ProgrammingErrorInfo: ErrorInfo; - begin - ProgrammingErrorInfo.Verbosity := Verbosity::Error; - ProgrammingErrorInfo.ErrorType := ProgrammingErrorInfo.ErrorType::Internal; - ProgrammingErrorInfo.Message := PageIDMustBeSpecifiedErr; - Error(ProgrammingErrorInfo); - end; - var PageSummarySettings: Codeunit "Page Summary Settings"; PageTxt: Label 'Page %1', Comment = '%1 is a whole number, ex. 10'; @@ -467,7 +452,6 @@ codeunit 2717 "Page Summary Provider Impl." GetPageUrlSuccessTelemetryTxt: Label 'Successfully added url for page %1.', Locked = true; NoRecordFieldsFoundTelemetryTxt: Label 'No record fields found for page %1.', Locked = true; GetRecordFieldsFailureTelemetryTxt: Label 'Failure to get record fields for page %1.', Locked = true; - PageIDMustBeSpecifiedErr: Label 'Page ID must be specified.', Locked = true; PageIDTok: Label 'pageId', Locked = true; RecordSystemIdTok: Label 'recordSystemId', Locked = true; BookmarkTok: Label 'bookmark', Locked = true;