Codeunit 30274 Shpfy Log Entries Delete

Shopify Connector, Microsoft.Integration.Shopify

src/Apps/W1/Shopify/App/src/Logs/Codeunits/ShpfyLogEntriesDelete.Codeunit.al44 lines, Copyright (c) Microsoft Corporation. MIT

// ------------------------------------------------------------------------------------------------// Copyright (c) Microsoft Corporation. All rights reserved.// Licensed under the MIT License. See License.txt in the project root for license information.// ------------------------------------------------------------------------------------------------namespace Microsoft.Integration.Shopify;using System.DataAdministration;codeunit 30274 "Shpfy Log Entries Delete"{    Access = Internal;    Permissions = tabledata "Shpfy Log Entry" = rd,                    tabledata "Shpfy Data Capture" = rd;    var        NoFiltersErr: Label 'No filters were set on table %1, %2. Please contact your Microsoft Partner for assistance.', Comment = '%1 = a id of a table (integer), %2 = the caption of the table.';    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Apply Retention Policy", 'OnApplyRetentionPolicyIndirectPermissionRequired', '', true, true)]    local procedure DeleteRecordsWithIndirectPermissionsOnApplyRetentionPolicyIndirectPermissionRequired(var RecRef: RecordRef; var Handled: Boolean)    var        RetentionPolicyLog: Codeunit "Retention Policy Log";    begin        if Handled then            exit;        if (RecRef.Number <> Database::"Shpfy Log Entry") and (RecRef.Number <> Database::"Shpfy Data Capture") then            exit;        // If no filters have been set, something is wrong        if (RecRef.GetFilters() = '') or (not RecRef.MarkedOnly()) then            RetentionPolicyLog.LogError(LogCategory(), StrSubstNo(NoFiltersErr, RecRef.Number, RecRef.Name));        RecRef.DeleteAll(true);        Handled := true;    end;    local procedure LogCategory(): Enum "Retention Policy Log Category"    var        RetentionPolicyLogCategory: Enum "Retention Policy Log Category";    begin        exit(RetentionPolicyLogCategory::"Retention Policy - Apply");    end;}