Skip to content

[E-Document] Remove Access = Internal from E-Doc. Data Exchange Impl. codeunit - #9014

Merged
Maria Zhelezova (mazhelez) merged 3 commits into
mainfrom
fix/remove-internal-access-edoc-dataexchimpl
Jul 14, 2026
Merged

[E-Document] Remove Access = Internal from E-Doc. Data Exchange Impl. codeunit#9014
Maria Zhelezova (mazhelez) merged 3 commits into
mainfrom
fix/remove-internal-access-edoc-dataexchimpl

Conversation

@Groenbech96

@Groenbech96 Magnus Hartvig Grønbech (Groenbech96) commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#641216

Removes Access = Internal from the E-Doc. Data Exchange Impl. codeunit (6152) so partners can reuse the functions in their own E-Document implementations.

@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jul 2, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Security} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

The Access = Internal; property was removed from codeunit 6152 "E-Doc.

Data Exchange Impl." (which implements the "E-Document" interface), widening the codeunit from app-internal to externally accessible. Nothing in this PR's own design docs calls for this change — the plan's "Global Constraints" section explicitly states "All codeunits in this area use Access = Internal" and "No breaking changes to existing behavior," and no other part of the diff depends on this codeunit being externally callable. This looks like an unintentional widening of the object's accessibility surface (e.g. a stray edit or merge artifact) rather than a deliberate design decision; if genuinely unintended, it silently increases the app's public API surface.

Recommendation:

  • restore Access = Internal; unless there is a documented reason (not present in this PR) for making the codeunit externally accessible. The real-world impact if unintended would be more than cosmetic (API-surface/compat exposure), so this is flagged for reviewer confirmation before merge even though the agent-finding channel caps its severity at minor.

Suggested fix (apply manually — could not be anchored as a one-click suggestion):

codeunit 6152 "E-Doc. Data Exchange Impl." implements "E-Document"
{
    Access = Internal;

Agent judgement — not directly backed by a BCQuality knowledge article.

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

Comment thread src/Apps/W1/EDocument/App/src/EDocumentInstall.Codeunit.al Outdated
Comment thread src/Apps/W1/EDocument/App/src/EDocumentInstall.Codeunit.al Outdated
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 4 · Outcome: completed

PR consists of two one-line removals of Access = Internal; from a table and a codeunit (namespace Microsoft.eServices.EDocument.IO.Peppol). No leaf sub-skill found a knowledge-backed or agent-level defect; sibling objects implementing the same 'E-Document' interface (EDocPEPPOLBIS30.Codeunit.al, EDocumentFormat.Enum.al) are already public, so the change appears to be a deliberate consistency fix rather than an accidental API-surface exposure.

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

Partners need to reuse the functions in their own implementations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Groenbech96
Magnus Hartvig Grønbech (Groenbech96) force-pushed the fix/remove-internal-access-edoc-dataexchimpl branch from 83bf494 to d6c2500 Compare July 2, 2026 06:49
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Style} \quad \color{gray}{\texttt{\small Iteration\ 2}}$

This diff removes Access = Internal; from codeunit 6152 "E-Doc.

Data Exchange Impl.", changing its default access to Public. The codeunit already declares multiple non-local procedures (Check, Create, CreateBatch, GetBasicInfoFromReceivedDocument, GetCompleteInfoFromReceivedDocument, ExtractHeaderFields, AddFieldToFieldBuffer, GetDataExchangePath) that are now genuinely callable from outside this app for the first time, and none of them carry XML documentation. Per the referenced guidance, public procedures on a now-exposed library codeunit should get <summary>/<param>/<returns> doc comments before the API surface is opened up. Note the sibling implementation "EDoc PEPPOL BIS 3.0" (codeunit 6165) has the same gap, so this is a pattern to address across both, not unique to this file.

Knowledge:

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Style} \quad \color{gray}{\texttt{\small Iteration\ 3}}$

The diff removes 'Access = Internal;' from codeunit 6152 "E-Doc.

Data Exchange Impl.", making it a public codeunit for the first time. This exposes 7 public procedures (Check, Create, CreateBatch, GetBasicInfoFromReceivedDocument, GetCompleteInfoFromReceivedDocument, ExtractHeaderFields, AddFieldToFieldBuffer, GetDataExchangePath) as part of the app's public/library surface without any XML documentation comments. Per the referenced guidance, public procedures on a library-role codeunit should carry

// XML docs so external consumers understand intent and preconditions.

Knowledge:

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

auto-merge was automatically disabled July 8, 2026 05:42

Pull request was closed

@Groenbech96

Copy link
Copy Markdown
Contributor Author

Copilot pull main into this pr

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Copilot pull main into this pr

Done — I merged main into this PR in commit e592a22e.

@github-actions github-actions Bot added needs-approval Workflow runs require maintainer approval to start and removed needs-approval Workflow runs require maintainer approval to start labels Jul 10, 2026
@mazhelez
Maria Zhelezova (mazhelez) merged commit 0767f9d into main Jul 14, 2026
324 of 328 checks passed
@mazhelez
Maria Zhelezova (mazhelez) deleted the fix/remove-internal-access-edoc-dataexchimpl branch July 14, 2026 13:43
pull Bot pushed a commit to CarstenMertes/BCApps that referenced this pull request Jul 29, 2026
…ice and API Reports (microsoft#9812)

## What & why

Refreshes the in-repo AL documentation (`CLAUDE.md` and `docs/*.md`
files that live alongside the apps) for four apps whose docs had drifted
behind the code.

This is **documentation only** -- no AL source is touched. 62 files: 56
markdown files plus six `.docs-updated` marker files.

Updates are change-driven, not a rewrite. For each app I established the
baseline from the commit that last wrote its docs, diffed every commit
since, mapped each changed AL object to the documentation that describes
it, and updated only the affected sections. Existing narrative and voice
were preserved.

| App | Docs baseline | Drift covered |
|---|---|---|
| **E-Document Core** | `a090c078` (2026-03-25) | 55 commits, 149 AL
files |
| **Shopify Connector** | `3227a356` (2026-04-14) | 48 commits |
| **Privacy Notice** | `41e62038` (2026-05-11) | 2 commits |
| **API Reports - Finance** | `f5e9cbee` (2026-03-20) | 1 commit |

`DataCorrectionFA` also has docs but has had no AL changes since they
were written, so it is untouched.

The commits are kept separate so each app can be reviewed independently.

A third commit adds `.docs-updated` markers for the four documented apps
that lacked one. Previously only Shopify had markers, so every other
app's baseline had to be inferred from the git history of its docs
folder -- which is precisely how E-Document drifted 55 commits behind
unnoticed. All 82 doc-bearing folders in the repo now roll up under one
of six markers, giving the next refresh an explicit baseline.

### E-Document Core

The docs were created in March and only three files were ever refreshed
since; the 18 module-level docs had not been touched at all.

- **Import V2 is now the default** for new services, with the draft
format selected on the service record. Documented the pipeline stages,
the reader interfaces, and how a partner plugs in a new inbound format
(microsoft#9702).
- **Data Exchange** definitions moved from labels to app resource files
(microsoft#9737), and the v2 bridge lets those definitions feed the V2 pipeline
(microsoft#7565). `Access = Internal` was removed from the Data Exchange Impl.
codeunit (microsoft#9014).
- **PEPPOL now lives in a standalone app** under `src/Apps/W1/PEPPOL`
(microsoft#8498). Added the EDI flows: purchase order send path (microsoft#7796), sales
order receive path (microsoft#8558), and order response message handling (microsoft#8698).
- **New structured format readers**, including XRechnung (microsoft#9690) and
OIOUBL (microsoft#9682).
- **Corrected stale documentation** that still described the E-Document
Purchase Order Matching Copilot as current. It is obsoleted (microsoft#9572);
AI-assisted line matching now happens at import time via `E-Doc. AI Tool
Processor`.
- Document date, due date and configurable default posting date
behaviour (microsoft#7953, microsoft#9575, microsoft#8740), plus VAT rate resolution and VAT amount
difference (microsoft#8251).
- `E-Document Purchase Header` / `Purchase Line` exposed for country-app
consumers (microsoft#8379), and Sales Header/Line data sensitivity classification
(microsoft#9105).
- Confirmed the `E-Document Header Mapping` / `Line Mapping` tables are
retained for compatibility only and are **not** part of the V2 draft
flow.

### Shopify Connector

- **Unlisted product status** and the new `ICreateProductStatusValue`
implementation (microsoft#9321, microsoft#9581).
- **HS code and country of origin**, carried on the variant and gated by
the Shop's `"Sync HS Code and Country"` field (microsoft#9320, microsoft#7414).
- **Order tax lines can now hang off order shipping charges** (microsoft#9537),
and market-driven shipping methods are fetched through new GraphQL
queries.
- **Return-with-exchange refunds**: the `"Is Exchange Item"` order line
flag and the synthetic negative refund lines that keep the credit memo
total matching `Refund.totalRefundedSet` (microsoft#8554).
- Credit memo creation is skipped while a refund transaction is pending
(microsoft#9112).
- Order mapping keeps a manually set `Sell-to Customer No.` when Bill-to
mapping fails (microsoft#9316), and creates a BC customer when Shopify has no
default address (microsoft#9188).
- Bulk price sync surfaces skipped records and the sent JSONL (microsoft#9211),
and decides bulk versus single on the count of *changed* prices (microsoft#9126).
- Corrected the **GraphQL rate limiter wait calculation** (microsoft#9146) and
the query count.
- `Auto Create Catalog` renamed to `Auto Create B2B Catalog`, now always
visible with plan validation on enable (microsoft#8647, microsoft#8213).
- Belgium Enterprise No. tax ID mapping (microsoft#9138) and ISO country code tax
area filtering (microsoft#8072).
- **Fixed a stale claim** in the Test docs that 3 tests were disabled
via app-local `DisabledTests/*.json`. Those files were deleted in microsoft#8274
and the folder no longer exists; disabled-test filtering now comes from
central `DisabledTests/<app>/` folders discovered by
`build/scripts/RunTestsInBcContainer.ps1`.

### Privacy Notice

- Registered the **Microsoft Copilot** privacy notice, whose default
approval is keyed to the **EU Data Boundary** (`not
ALCopilotFunctions.IsWithinEUDB()`), so EEA environments start
unapproved and require an explicit admin decision (microsoft#9206).
- Noted the inherent permissions on the public facade that let
service-invoked callers reach it without holding Privacy Notice
permissions (microsoft#9482).

### API Reports - Finance

- The six API queries now carry `AboutText`, consumed by MCP tooling for
tool selection (microsoft#6670). Documented that this is a functional description
aimed at an agent, not a caption.

## Linked work

Fixes
[AB#644610](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/644610)
Fixes
[AB#644608](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/644608)

No GitHub issue. This is a documentation-only maintenance refresh of the
docs that live alongside these apps, not a product change, so there is
no user-facing bug to file. Tracked internally by the two ADO tasks
above.

## How I validated this

- [x] I read the full diff and it contains only changes I intended.
- [ ] I built the affected app(s) locally with no new analyzer warnings.
*(Not applicable -- no AL source changed. See below.)*
- [ ] I ran the change in Business Central and confirmed it behaves as
expected. *(Not applicable -- documentation only.)*
- [x] I added or updated tests for the new behavior, or explained below
why none are needed.

**What I tested and the outcome**

Since this changes no compiled code, validation was about factual
accuracy rather than build or runtime behaviour. Claims were checked
against the AL source at `d86ecf32`:

- `git diff --name-only` confirms only `.md` files and the two
`.docs-updated` markers changed. Zero `.al` files.
- **E-Document**: enumerated the actual interfaces under
`src/Processing` and reconciled them against the extensibility docs.
This caught a wrong pre-existing claim -- the old docs documented an
`IPurchaseInvoiceProvider` interface that **does not exist**. The real
interfaces are `IEDocumentCreatePurchaseInvoice`,
`IEDocumentCreatePurchaseCreditMemo` and `IEDocumentCreateSalesOrder`,
which the refreshed docs now use. Also verified the Copilot
`ObsoleteReason` text, the standalone PEPPOL `app.json`, and that the
only remaining reference to `E-Document Line Mapping` outside its own
definition is the data-classification registration in
`EDocumentSubscribers`.
- **Shopify**: verified `Shpfy Shop` field 208 `"Find Mapping by
Barcode"` and field 209 `"Sync HS Code and Country"`, `Unlisted` on both
product-status enums, `Shpfy Order Line` field 22 `"Is Exchange Item"`,
and `ShpfyShippingCharges.UpdateShippingCostInfos`. Verified the GraphQL
claim numerically: 149 `.graphql` resource files matches 149
`ShpfyGraphQLType` enum values. Verified the DisabledTests correction by
confirming the folder is gone and reading `Get-DisabledTests` in
`RunTestsInBcContainer.ps1`. Verified
`BindSubscription(BulkOpSubscriber)` appears only in
`ShpfyWebhooksTest`.
- **Privacy Notice**: read `GetMicrosoftCopilotID`,
`TryGetMicrosoftCopilotDefaultApproval` and the
`InherentEntitlements`/`InherentPermissions` declarations.
- **API Reports**: confirmed `AboutText` is on exactly the six query
objects and no pages.
- Style and integrity checks all clean: `git diff --check`, no em
dashes, no unclosed code fences, correct list spacing, no broken anchor
links, all files CRLF.
- No tests are needed because no product behaviour changed.

I used agents to draft the per-module updates, then reviewed the diffs
myself and corrected several things on top of their output: a
speculative `TODO` about the Shopify bulk subscriber binding path (it is
bound in `ShpfyWebhooksTest`), a `TODO` about the E-Document mapping
tables (resolved by checking actual usage), the `"Sync HS Code and
Country"` field name versus its caption, a missing
`IProcessStructuredDataSales` reference in the sales guidance, and LF
line endings on six Test files that should have been CRLF.

## Risk & compatibility

None. Documentation only -- no runtime, upgrade, permission, or
telemetry impact, and nothing that affects the compiled apps.

Two things worth a reviewer's eye:

1. The E-Document Import extensibility doc was **reorganized**, not just
appended to. Four narrow sections were consolidated into "Customize
purchase resolution" and "Customize purchase finalization", and new
sections were added for the Data Exchange bridge and sales order import.
I checked the specific knowledge survived (provider defaults, the
obsolete `IPurchaseLineAccountProvider` note, UOM resolution order), but
the section structure did change.
2. The docs now assert fairly specific behaviour in areas I did not
exercise in a container, particularly the PEPPOL
send/receive/order-response flows, the E-Document V2 reader pipeline,
and Shopify refund exchange lines. Statements are traced to source, but
confirmation from the owners of those areas would be valuable.

Shopify docs were deliberately left untouched for Payments and Order
Fulfillments -- their only changes in the range were timestamp caption
and tooltip wording with no behavioural meaning.

---

*This supersedes microsoft#9808 (Shopify) and microsoft#9811 (E-Document), which are
closed in favour of this single PR.*

---------

Co-authored-by: Magnus Hartvig Grønbech <magnushar@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants