---
id: change/bcapps/9910
type: change
title: "#9910 [SOA] Move attachment processing to direct model reading"
summary: Sales Order Agent now processes PDF and image attachments directly with GPT-4.1 mini to extract structured JSON containing customer references, item details, quantities, and dates, replacing platform-generated attachment text before relevance validation.
tier: official
language: en
tags:
  - feature
  - main
  - bc30
  - codeunit soa annotation
  - codeunit soa attachment mllm
  - enum soa email attachment status
  - codeunit soa instructions
  - codeunit soa validation function
  - codeunit aoai deployments
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:08:48.759Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: fc58541857ac2b88a01a9eebe01b63bf21e30b22
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9910
    title: "microsoft/BCApps#9910: [SOA] Move attachment processing to direct model reading"
    date: "2026-08-15"
    commit: fc58541857ac2b88a01a9eebe01b63bf21e30b22
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/4399
    - object/codeunit/4421
    - object/enum/4594
    - object/codeunit/4598
    - object/codeunit/4302
    - object/codeunit/7768
    - object/codeunit/7769
    - object/codeunit/7764
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9910
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9910
kind: pr
base_branch: main
major: "30"
merged_at: "2026-08-15T04:09:46Z"
author: qasimikram
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "AL: System Application"
  - "AL: Tools"
  - "Team: SCM"
change_class: code
change_kind: feature
behavior_change: true
breaking: false
files:
  count: 20
  additions: 719
  deletions: 57
  al: 8
apps:
  - SalesOrderAgent
  - System Application
objects_touched:
  - key: codeunit/4399
    page: codeunit/4399
    type: codeunit
    id: 4399
    name: SOA Annotation
    app: SalesOrderAgent
    status: modified
  - key: codeunit/4421
    page: codeunit/4421
    type: codeunit
    id: 4421
    name: SOA Attachment MLLM
    app: SalesOrderAgent
    status: added
  - key: enum/4594
    page: enum/4594
    type: enum
    id: 4594
    name: SOA Email Attachment Status
    app: SalesOrderAgent
    status: modified
  - key: codeunit/4598
    page: codeunit/4598
    type: codeunit
    id: 4598
    name: SOA Instructions
    app: SalesOrderAgent
    status: modified
  - key: codeunit/4302
    page: codeunit/4302
    type: codeunit
    id: 4302
    name: SOA Validation Function
    app: SalesOrderAgent
    status: modified
  - key: codeunit/7768
    page: codeunit/7768
    type: codeunit
    id: 7768
    name: AOAI Deployments
    app: System Application
    status: modified
  - key: codeunit/7769
    page: codeunit/7769
    type: codeunit
    id: 7769
    name: AOAI Deployments Impl
    app: System Application
    status: modified
  - key: codeunit/7764
    page: codeunit/7764
    type: codeunit
    id: 7764
    name: AOAI Chat Messages Impl
    app: System Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 641231
systems:
  - development
  - copilot
quote: null
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #9910 [SOA] Move attachment processing to direct model reading

> Sales Order Agent now processes PDF and image attachments directly with GPT-4.1 mini to extract structured JSON containing customer references, item details, quantities, and dates, replacing platform-generated attachment text before relevance validation.

[Pull request](https://github.com/microsoft/BCApps/pull/9910) · merged into `main` (BC30) on 2026-08-15 by qasimikram · 20 files (+719 -57), 8 AL · feature · tier official · reviewed (checked by Opus)

## What changed

- Attachments are sent directly to a multimodal model to extract SOA-focused JSON with item descriptions, identifiers, quantities, and dates
- Failed extractions are marked with ExtractionFailed status rather than causing message failure, allowing processing to continue
- Extracted JSON is cached on the attachment using the attachment's SystemId to prevent recomputation on subsequent processing
- Schema marker in content guards against reprocessing previously extracted attachments
- Extraction contract is intentionally open to accommodate varying document structures and item attributes
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 4399 "SOA Annotation"](../../objects/codeunit/4399.md), SalesOrderAgent: modified
- [Codeunit 4421 "SOA Attachment MLLM"](../../objects/codeunit/4421.md), SalesOrderAgent: added
- [Enum 4594 "SOA Email Attachment Status"](../../objects/enum/4594.md), SalesOrderAgent: modified
- [Codeunit 4598 "SOA Instructions"](../../objects/codeunit/4598.md), SalesOrderAgent: modified
- [Codeunit 4302 "SOA Validation Function"](../../objects/codeunit/4302.md), SalesOrderAgent: modified
- [Codeunit 7768 "AOAI Deployments"](../../objects/codeunit/7768.md), System Application: modified
- [Codeunit 7769 "AOAI Deployments Impl"](../../objects/codeunit/7769.md), System Application: modified
- [Codeunit 7764 "AOAI Chat Messages Impl"](../../objects/codeunit/7764.md), System Application: modified

## Context

- Work items: AB#641231
- Labels: AL: Apps (W1), AL: System Application, AL: Tools, Team: SCM
- Systems: development, copilot

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