{"title":"Codeunit 3322 PA Email Cleanup, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/3322-pa-email-cleanup/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"codeunit","id":3322,"name":"PA Email Cleanup","app":"Payables Agent","url":"https://jonas-paprotka.de/ref/codeunit/3322-pa-email-cleanup/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/3322-pa-email-cleanup/source/","path":"src/Apps/W1/PayablesAgent/app/EmailStorageCleanup/PAEmailCleanup.Codeunit.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"table:3321":{"name":"PA Email Duplicate Buffer","url":"https://jonas-paprotka.de/ref/table/3321-pa-email-duplicate-buffer/"},"table:3320":{"name":"PA Email Cleanup Setup","url":"https://jonas-paprotka.de/ref/table/3320-pa-email-cleanup-setup/"},"codeunit:3328":{"name":"PA Email Inbox Row Delete","url":"https://jonas-paprotka.de/ref/codeunit/3328-pa-email-inbox-row-delete/"}},"procs":[{"name":"BuildDuplicateGroups","line":24,"kind":"procedure","params":1,"steps":[[34,"write",3321,"DeleteAll"],[50,"call","StartGroup",3],[54,"call","FlushGroup",3],[57,"call","StartGroup",3],[59,"call","ExtendGroup",3],[62,"call","FlushGroup",3],[68,"call","LogScanTelemetry",2]]},{"name":"GetDuplicateStatistics","line":71,"kind":"procedure","params":3,"steps":[[75,"call","BuildDuplicateGroups",1]]},{"name":"CleanUpDuplicates","line":87,"kind":"procedure","params":0,"steps":[[96,"ext","table",3320,"GetCommitBatchSize",0],[97,"ext","table",3320,"GetDeletionLimit",0],[99,"call","BuildDuplicateGroups",1],[104,"call","DeleteRedundantRowsOfGroup",6],[109,"call","RecordLastRun",2],[110,"call","LogCleanupTelemetry",4]]},{"name":"DeleteRedundantRowsOfGroup","line":113,"kind":"procedure","access":"internal","params":6,"steps":[[134,"call","IsSafeToDelete",1],[138,"run","codeunit",3328]]},{"name":"FlushGroup","line":187,"kind":"procedure","access":"local","params":3,"steps":[[196,"call","IsSafeToDelete",1],[205,"write",3321,"Insert"]]},{"name":"RecordLastRun","line":209,"kind":"procedure","access":"local","params":2,"steps":[[213,"ext","table",3320,"GetSingleton",0],[217,"write",3320,"Modify"]]}]}