---
title: "Codeunit 3322 PA Email Cleanup"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/3322-pa-email-cleanup/
type: codeunit
id: 3322
name: "PA Email Cleanup"
app: "Payables Agent"
namespace: Microsoft.Agent.PayablesAgent
versions: "29"
build: 29.0.54011.55644
countries: "W1, DE, US"
source: "https://jonas-paprotka.de/ref/codeunit/3322-pa-email-cleanup/source/"
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
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/"
---

# Codeunit 3322 PA Email Cleanup

JOP-AL, https://jonas-paprotka.de/ref/codeunit/3322-pa-email-cleanup/

| | |
| --- | --- |
| App | Payables Agent |
| Namespace | Microsoft.Agent.PayablesAgent |
| Versions | 29 |
| Minors | W1 29.0; DE 29.0; US 29.0, [every minor](https://jonas-paprotka.de/ref/codeunit/3322-pa-email-cleanup/editions.json) |
| Access | Internal |
| Source file | EmailStorageCleanup/PAEmailCleanup.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| BuildDuplicateGroups | (var TempDuplicateBuffer: Record "PA Email Duplicate Buffer" temporary) | Integer | public | 29 | - | - |
| GetDuplicateStatistics | (var GroupCount: Integer; var RedundantRowCount: Integer; var SkippedRowCount: Integer) | - | public | 29 | - | - |
| CleanUpDuplicates | () | Integer | public | 29 | - | - |
| DeleteRedundantRowsOfGroup | (var TempDuplicateBuffer: Record "PA Email Duplicate Buffer" temporary; CommitBatchSize: Integer; DeleteLimit: Integer; var DeletedCount: Integer; var SkippedCount: Integer; var UncommittedCount: Integer) | - | internal | 29 | - | - |
| IsSafeToDelete | (MessageId: Guid) | Boolean | internal | 29 | - | - |

## Source

Symbols: Microsoft.PayablesAgent.symbols.14aa1237-2f69-4c25-9a68-fa7d54e08613, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-11-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
