Skip to content

Default new E-Document services to import v2 and expose the version selector#9654

Open
Groenbech96 wants to merge 2 commits into
mainfrom
edoc-v2-default
Open

Default new E-Document services to import v2 and expose the version selector#9654
Groenbech96 wants to merge 2 commits into
mainfrom
edoc-v2-default

Conversation

@Groenbech96

@Groenbech96 Groenbech96 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What & why

Step 1 of moving the E-Document framework's inbound import onto the v2 draft pipeline: make Version 2.0 the default for newly created services and expose the version selector in the UI. Concretely:

  • Default new services to v2 — add InitValue = "Version 2.0" to field(31) "Import Process" on table E-Document Service. Any service initialized via Rec.Init() (the service card's "New", programmatic creation) now starts on the v2 draft pipeline. Existing/stored services are untouched.
  • Expose the version on the service card — remove Visible = false from the "Import Process" field on page E-Document Service so users can see and switch the version. The value-driven PurchaseDraft (v2) and ImportParamenters (v1) groups already toggle off this field.

Deliberately NOT in scope: no obsoletion/deprecation of v1. The local format apps (PEPPOL, XRechnung, ZUGFeRD, OIOUBL, Factura-E, Verifactu, FacturX, PINT ANZ, EReporting) are not yet migrated off the v1 inbound path, so v1 stays fully functional and selectable. Deprecation is a later step once formats are migrated.

Linked work

Fixes #

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • Added unit test NewServiceDefaultsToImportProcessV2 in EDocProcessTest.Codeunit.al: a freshly Init()-ed E-Document Service asserts "Import Process" = "Version 2.0".
  • Test-preservation: the existing receive/flow/E2E suites rely on service factories producing v1 (so the v1 mock subscribers run). All nine Init()-only factories in LibraryEDocument.Codeunit.al are now pinned to Version 1.0, so those suites exercise v1 exactly as before — the only observers of the new v2 default are production Init() and the new unit test. Tests that need v2 already opt in explicitly ("Import Process" := "Version 2.0").
  • Verified statically that the InitValue default only reaches records via Rec.Init(): the sole non-factory inline service creators are EDocAPITest (version-agnostic), the Microsoft365 Outlook test (no Init() → unaffected), and demo-data codeunits (not consumed by any test; the inbound demo service is already explicitly v2).
  • Not built/run locally: this environment has no AL symbols/compiler, so compilation and in-product verification are left to CI and the PR author. The change is a strict subset of the previously reviewed Make E-Document import processing v2 (drafts) the default; deprecate v1 inbound import #9649 (which this supersedes), minus all obsoletion.

Risk & compatibility

  • New services only. InitValue changes the default for records created via Init(); existing service records keep their stored value. No upgrade/data migration.
  • No breaking changes / no obsoletes. v1 remains selectable and functional; nothing is marked Obsolete and no #if/pragma guards were added.
  • Demo data: the outbound-purposed E-DOCUMENTS demo service inherits the new v2 default (Import Process is irrelevant to its send workflow); the inbound demo service was already v2.
  • Follow-up: migrate the local format apps onto v2, then deprecate the v1 inbound path.

…ersion on service card

Make Version 2.0 (draft pipeline) the default import process for newly
created E-Document services via InitValue on field 31, and surface the
"Import Process" version selector on the E-Document Service card so users
can view and switch versions. Existing services are unaffected.

No v1 deprecation/obsoletion: local format apps are not yet migrated off
the v1 inbound path, so v1 remains fully functional and selectable.

Test preservation: pin all nine LibraryEDocument service factories to
Version 1.0 so the existing receive/flow/E2E suites (which rely on the v1
mock subscribers) keep exercising v1 exactly as before. Add a unit test
asserting a freshly initialized service defaults to Version 2.0. Update
module docs to note the new default and selectability.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Groenbech96
Groenbech96 requested review from a team July 22, 2026 09:32
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Integration GitHub request for Integration area labels Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234'

The ForNAV connector creates its E-Document Service via Insert() without
setting "Import Process". Now that the field defaults to "Version 2.0", the
service inherited the v2 draft pipeline, which broke the SubmitGetDocuments
integration test (codeunit 148221) that asserts the v1 inbound behavior of
creating a Purchase Invoice E-Document directly.

ForNAV inbound is not migrated to the v2 pipeline, so explicitly pin the
service to "Version 1.0" at creation time, matching the pattern already used
for the mock services in codeunit "Library - E-Document".

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 Integration GitHub request for Integration area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant