code change · fixAL Developmentofficial - Microsoftreviewed - checked by Opus

#10055 Fix: migrating a document attachment deletes shared Tenant Media

Document attachment migration no longer deletes shared Tenant Media records, preventing silent loss of content when attachments are copied to posted documents.

Pull request · merged into main (BC30) on 2026-08-17 by Groenbech96 · 26 files (+198 -7), 1 AL · fix · tier official · reviewed (checked by Opus)

What changed

  • Adds guard to prevent deletion of Tenant Media when other attachments reference the same media row
  • Introduces three new unit tests verifying shared media protection and proper cleanup when attachment is the sole owner
  • Fixes silent skipping of copied attachments during external storage migration that left records with missing content
  • Protects internal Tenant Media deletion the same way external blob deletion was already protected
  • Behaviour changes for users or extensions.

AL objects touched

Context

  • Work items: AB#646505
  • Labels: AL: Apps (W1), Build: scripts & configs, Team: Integrations
  • Systems: development
  • From the description: “Deleting that row on behalf of one attachment destroys the content of every attachment copied from it.”

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).