diff --git a/businessCentral/app/permissions/Execute.PermissionSet.al b/businessCentral/app/permissions/Execute.PermissionSet.al index 973a0ee..9a7cad4 100644 --- a/businessCentral/app/permissions/Execute.PermissionSet.al +++ b/businessCentral/app/permissions/Execute.PermissionSet.al @@ -18,6 +18,7 @@ permissionset 82561 "ADLSE - Execute" tabledata "ADLSE Run" = RIMD, tabledata "ADLSE Enum Translation" = RIMD, tabledata "ADLSE Enum Translation Lang" = RIMD, + tabledata "Deleted Tables Not to Sync" = R, codeunit "ADLSE UpgradeTagNewCompanySubs" = X, codeunit "ADLSE Upgrade" = X, codeunit "ADLSE Util" = X, diff --git a/businessCentral/app/permissions/Setup.PermissionSet.al b/businessCentral/app/permissions/Setup.PermissionSet.al index a0848bf..13c401e 100644 --- a/businessCentral/app/permissions/Setup.PermissionSet.al +++ b/businessCentral/app/permissions/Setup.PermissionSet.al @@ -18,6 +18,7 @@ permissionset 82560 "ADLSE - Setup" tabledata "ADLSE Run" = RD, tabledata "ADLSE Enum Translation" = RIMD, tabledata "ADLSE Enum Translation Lang" = RIMD, + tabledata "Deleted Tables Not to Sync" = RIMD, codeunit "ADLSE Clear Tracked Deletions" = X, codeunit "ADLSE Credentials" = X, codeunit "ADLSE Setup" = X, diff --git a/businessCentral/app/src/DeletedTablesNotToSync.Page.al b/businessCentral/app/src/DeletedTablesNotToSync.Page.al new file mode 100644 index 0000000..45763c1 --- /dev/null +++ b/businessCentral/app/src/DeletedTablesNotToSync.Page.al @@ -0,0 +1,43 @@ +page 82564 "Deleted Tables Not To Sync" +{ + PageType = List; + ApplicationArea = All; + SourceTable = "Deleted Tables Not to Sync"; + + layout + { + area(Content) + { + repeater(GroupName) + { + field(TableId; rec.TableId) + { + trigger OnLookup(var Text: Text): Boolean + var + TableMetadata: Record "Table Metadata"; + begin + GetTableId(TableMetadata); + if Page.RunModal(Page::"Available Table Selection List", TableMetadata) = Action::LookupOK then + rec.TableId := TableMetadata.ID; + end; + } + field("Table Caption"; rec."Table Caption") { } + } + } + } + local procedure GetTableId(var TableMetadata: Record "Table Metadata") + var + ADLSETable: Record "ADLSE Table"; + TableFilterTxt: Text; + begin + ADLSETable.Reset(); + if ADLSETable.FindSet() then + repeat + if TableFilterTxt = '' then + TableFilterTxt := Format(ADLSETable."Table ID") + else + TableFilterTxt += '|' + Format(ADLSETable."Table ID"); + until ADLSETable.Next() = 0; + TableMetadata.SetFilter(TableMetadata.ID, TableFilterTxt); + end; +} \ No newline at end of file diff --git a/businessCentral/app/src/DeletedTablesNotToSync.Table.al b/businessCentral/app/src/DeletedTablesNotToSync.Table.al new file mode 100644 index 0000000..7911565 --- /dev/null +++ b/businessCentral/app/src/DeletedTablesNotToSync.Table.al @@ -0,0 +1,31 @@ +table 82569 "Deleted Tables Not to Sync" +{ + DataClassification = ToBeClassified; + + fields + { + field(1; TableId; Integer) + { + DataClassification = ToBeClassified; + TableRelation = "ADLSE Table"."Table ID"; + Caption = 'Table ID'; + ToolTip = 'Specify the ID of the table that should not be tracked for deletes.'; + } + field(5; "Table Caption"; Text[100]) + { + CalcFormula = lookup(AllObjWithCaption."Object Name" where("Object ID" = field(TableId))); + Caption = 'Table Caption'; + Editable = false; + FieldClass = FlowField; + ToolTip = 'Specifies the caption of the table whose data is to exported.'; + } + } + + keys + { + key(Key1; TableId) + { + Clustered = true; + } + } +} \ No newline at end of file diff --git a/businessCentral/app/src/Execution.Codeunit.al b/businessCentral/app/src/Execution.Codeunit.al index 2137991..fc71da2 100644 --- a/businessCentral/app/src/Execution.Codeunit.al +++ b/businessCentral/app/src/Execution.Codeunit.al @@ -205,11 +205,10 @@ codeunit 82569 "ADLSE Execution" var ADLSETableLastTimestamp: Record "ADLSE Table Last Timestamp"; ADLSEDeletedRecord: Record "ADLSE Deleted Record"; + DeletedTablesNottoSync: Record "Deleted Tables Not to Sync"; begin - // exit function for tables that you do not wish to sync deletes for - // you should also consider not registering for deletes for the table in the function GetDatabaseTableTriggerSetup above. - // if RecRef.Number = Database::"G/L Entry" then - // exit; + if DeletedTablesNottoSync.Get(RecRef.Number) then + exit; // check if table is to be tracked. if not ADLSETableLastTimestamp.ExistsUpdatedLastTimestamp(RecRef.Number) then diff --git a/businessCentral/app/src/Setup.Page.al b/businessCentral/app/src/Setup.Page.al index 602ccaa..cc6ac8e 100644 --- a/businessCentral/app/src/Setup.Page.al +++ b/businessCentral/app/src/Setup.Page.al @@ -278,6 +278,14 @@ page 82560 "ADLSE Setup" Image = Translations; RunObject = page "ADLSE Enum Translations"; } + action(DeletedTablesNotToSync) + { + ApplicationArea = All; + Caption = 'Deleted tables not to sync'; + ToolTip = 'Shows all the tables that are specified not to be tracked for deletes.'; + Image = Delete; + RunObject = page "Deleted Tables Not To Sync"; + } } area(Promoted) {