---
id: object/page/3325
type: object
title: Page 3325 "PA Email Storage Cleanup"
summary: Page 3325 "PA Email Storage Cleanup" in PayablesAgent (Microsoft.Agent.PayablesAgent). Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - page
  - payablesagent
versions:
  introduced: "29"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 96cdae00ea74fb627e414e3300a027b706db066a5b09a04c921419798e316c87
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/PayablesAgent/app/EmailStorageCleanup/PAEmailStorageCleanup.Page.al
    title: src/Apps/W1/PayablesAgent/app/EmailStorageCleanup/PAEmailStorageCleanup.Page.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/11950
    - change/bcapps/11890
object_type: page
object_id: 3325
name: PA Email Storage Cleanup
caption: Payables Agent Email Storage Cleanup
namespace: Microsoft.Agent.PayablesAgent
app: PayablesAgent
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 2
  events: 0
  subscribers: 0
  controls: 14
  actions: 6
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 0
  implements: 0
---

# Page 3325 "PA Email Storage Cleanup"

> Page 3325 "PA Email Storage Cleanup" in PayablesAgent (Microsoft.Agent.PayablesAgent). Introduced in BC29, still in BC30.

PayablesAgent · Microsoft.Agent.PayablesAgent · captioned "Payables Agent Email Storage Cleanup" · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/PayablesAgent/app/EmailStorageCleanup/PAEmailStorageCleanup.Page.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Caption | Payables Agent Email Storage Cleanup |
| Extensible | false |
| SourceTable | PA Email Cleanup Setup |
| PageType | Card |
| UsageCategory | None |
| ApplicationArea | All |

## Fields on this page

Layout controls in source order, grouped by the container they sit in. Shows: the table field a control is bound to (or its expression as written); ToolTip: the control's own, else the bound field's (marked).

| Group | Control | Shows | ToolTip |
|---|---|---|---|
| Status | Affected emails | `DuplicateGroupCount` | Specifies how many distinct emails currently have more than one copy stored in the Email Inbox. |
|  | Redundant copies to delete | `RedundantRowCount` | Specifies how many Email Inbox rows the cleanup would delete. The oldest copy of each email is always kept. |
|  | Copies to skip (not cleaned) | `SkippedRowCount` | Specifies how many redundant copies would be skipped because their email message is shared with another inbox row, or has been sent or queued to send. These need manual review. |
|  | Last checked | `LastScannedAt` | Specifies when the affected-email figures above were last calculated. |
| Cleanup configuration | CommitBatchSize | [Commit Batch Size](../table/3320.md#fields) | Specifies how many Email Inbox rows are deleted before the deletions are committed. Smaller batches keep transactions and locks short on large inboxes; rows deleted before an interruption stay deleted. |
|  | LimitRowsToDelete | [Limit Rows To Delete](../table/3320.md#fields) | Specifies whether a cleanup deletes only a limited number of copies. Enable this to do a small test run and verify the outcome before deleting everything. |
|  | RowsToDeleteLimit | [Rows To Delete Limit](../table/3320.md#fields) | Specifies the maximum number of redundant copies a cleanup deletes in one run. The rest are left for a later run. Only used when the test-run limit is enabled. |
|  | StartingDateTime | [Starting Date/Time](../table/3320.md#fields) | Specifies the earliest date and time the background cleanup is allowed to start. Leave blank to start as soon as the job queue picks it up. |
| Background cleanup | Schedule status | `ScheduleStatusText` | Specifies the live state of the background cleanup, read from its Job Queue entry. |
|  | Next run | `ScheduledAt` | Specifies the earliest start time the job queue will honour for the scheduled cleanup. |
|  | Last background error | `BackgroundError` | Specifies the error reported by the last background cleanup run, if it failed. Open the background job for the full Job Queue log. |
|  | LastRunAt | [Last Run At](../table/3320.md#fields) | Specifies when the cleanup last deleted rows. |
|  | LastDeletedCount | [Last Deleted Count](../table/3320.md#fields) | Specifies how many redundant copies the last run deleted. |
|  | LastSkippedCount | [Last Skipped Count](../table/3320.md#fields) | Specifies how many copies the last run skipped because they were shared, sent, queued, or could not be deleted. |

## Actions

| Group | Action | ToolTip | Runs |
|---|---|---|---|
| Processing | Check for duplicates | Recalculate how many emails are affected and how many redundant copies would be deleted. |  |
|  | View affected emails | Open the list of affected emails with the number of stored copies of each. |  |
|  | Activate scheduled cleanup | Queue the background cleanup using the configuration above. It keeps the oldest copy of each email and deletes the rest. This cannot be undone. |  |
|  | Clean up now | Queue a one-off cleanup to start immediately, independent of the recurring schedule. It keeps the oldest copy of each email and deletes the rest. This cannot be undone. |  |
|  | Cancel scheduled cleanup | Remove the scheduled background cleanup job. Rows already deleted stay deleted. |  |
|  | Open background job | Open the Job Queue Entry of the background cleanup for diagnostics. |  |

## Procedures

2 local procedures, no public ones.

## Triggers

OnAfterGetRecord, OnOpenPage

## Relations

- source table [Table 3320 "PA Email Cleanup Setup"](../table/3320.md)

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 3324 "PA Email Cleanup Scheduler"](../codeunit/3324.md) (5 calls: `RefreshScheduleState → GetLastError`, `RefreshScheduleState → GetScheduledAt`, `RefreshScheduleState → GetStatusText`, …)
- [Codeunit 3322 "PA Email Cleanup"](../codeunit/3322.md) (1 call: `RefreshStatistics → GetDuplicateStatistics`)

## Recent changes

- 2026-09-28 [#11950 Adding an in-product email storage cleanup (backport to releases/29.x)](../../changes/bcapps/11950.md) (releases/29.x, BC29, feature, added)
- 2026-09-28 [#11890 Adding an in-product email storage cleanup](../../changes/bcapps/11890.md) (main, BC30, feature, added)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "page", object_name: "PA Email Storage Cleanup")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
