---
id: change/bcapps/11612
type: change
title: "#11612 Multiple runs of email retrieval on the same emails don't persist again"
summary: Email retrieval no longer creates duplicate entries when the same emails are retrieved multiple times. A new centralized FindRetrievedEmail method helps connectors check if an email was already stored, and attachments are added only when needed.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit email - outlook api helper
  - codeunit email
  - codeunit email impl
  - table email inbox
  - codeunit email message
  - codeunit email message impl.
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:04:18.253Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: f8ac786696c9b115ca86bdb2fde33282979f4560
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/11612
    title: "microsoft/BCApps#11612: Multiple runs of email retrieval on the same emails don't persist again"
    date: "2026-09-21"
    commit: f8ac786696c9b115ca86bdb2fde33282979f4560
    t: null
    quote: Email is returned without further persisting, unless the previous email was stored without attachments, in which case only the attachment is added.
links:
  learn: []
  objects:
    - object/codeunit/4509
    - object/codeunit/8901
    - object/codeunit/8900
    - object/table/8886
    - object/codeunit/8904
    - object/codeunit/8905
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 11612
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/11612
kind: pr
base_branch: main
major: "30"
merged_at: "2026-09-21T13:17:50Z"
author: mynjj
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "AL: System Application"
  - "Team: Integrations"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 7
  additions: 262
  deletions: 5
  al: 6
apps:
  - Email - Outlook REST API
  - System Application
objects_touched:
  - key: codeunit/4509
    page: codeunit/4509
    type: codeunit
    id: 4509
    name: Email - Outlook API Helper
    app: Email - Outlook REST API
    status: modified
  - key: codeunit/8901
    page: codeunit/8901
    type: codeunit
    id: 8901
    name: Email
    app: System Application
    status: modified
  - key: codeunit/8900
    page: codeunit/8900
    type: codeunit
    id: 8900
    name: Email Impl
    app: System Application
    status: modified
  - key: table/8886
    page: table/8886
    type: table
    id: 8886
    name: Email Inbox
    app: System Application
    status: modified
  - key: codeunit/8904
    page: codeunit/8904
    type: codeunit
    id: 8904
    name: Email Message
    app: System Application
    status: modified
  - key: codeunit/8905
    page: codeunit/8905
    type: codeunit
    id: 8905
    name: Email Message Impl.
    app: System Application
    status: modified
objects_unjoined: []
obsoletions: []
backports:
  - number: 11624
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/11624
fixes_issues: []
work_items:
  - 650461
systems:
  - development
quote: Email is returned without further persisting, unless the previous email was stored without attachments, in which case only the attachment is added.
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #11612 Multiple runs of email retrieval on the same emails don't persist again

> Email retrieval no longer creates duplicate entries when the same emails are retrieved multiple times. A new centralized FindRetrievedEmail method helps connectors check if an email was already stored, and attachments are added only when needed.

[Pull request](https://github.com/microsoft/BCApps/pull/11612) · merged into `main` (BC30) on 2026-09-21 by mynjj · 7 files (+262 -5), 6 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- The Outlook connector now checks if an email was previously retrieved before persisting it again
- A new centralized FindRetrievedEmail method on the Email module consolidates this logic for all connectors
- Attachments are added to already-retrieved emails only if they weren't previously stored
- A new AddAttachment overload allows adding attachments without triggering validation that prevents modifying received emails
- The fix prevents the email message Modify subscriber from blocking legitimate attachment additions
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 4509 "Email - Outlook API Helper"](../../objects/codeunit/4509.md), Email - Outlook REST API: modified
- [Codeunit 8901 "Email"](../../objects/codeunit/8901.md), System Application: modified
- [Codeunit 8900 "Email Impl"](../../objects/codeunit/8900.md), System Application: modified
- [Table 8886 "Email Inbox"](../../objects/table/8886.md), System Application: modified
- [Codeunit 8904 "Email Message"](../../objects/codeunit/8904.md), System Application: modified
- [Codeunit 8905 "Email Message Impl."](../../objects/codeunit/8905.md), System Application: modified

## Also merged into

- [#11624](https://github.com/microsoft/BCApps/pull/11624) into `releases/29.x` on 2026-09-21

## Context

- Work items: AB#650461
- Labels: AL: Apps (W1), AL: System Application, Team: Integrations
- Systems: development
- From the description: "Email is returned without further persisting, unless the previous email was stored without attachments, in which case only the attachment is added."

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
