Skip to content

Default new E-Document services to import v2 and let users select the draft format#9702

Merged
Groenbech96 merged 3 commits into
mainfrom
edoc-v2-read-into-draft
Jul 24, 2026
Merged

Default new E-Document services to import v2 and let users select the draft format#9702
Groenbech96 merged 3 commits into
mainfrom
edoc-v2-read-into-draft

Conversation

@Groenbech96

@Groenbech96 Groenbech96 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Why

New E-Document services should default to the v2 import pipeline and let users actually configure it end-to-end. This needs two things that belong together:

  1. Making the Import Process selector visible on the service card and defaulting new services to Version 2.0.
  2. Letting the user pick the format v2 needs to read an incoming structured document into a draft.

That format is the service-level "Read into Draft Impl." field (table 6103, field 33). For already-structured formats such as PEPPOL XML the "Structure received data" step returns Unspecified, so ImportEDocumentProcess.ReadIntoDraft falls back to this service field:

if EDocument."Read into Draft Impl." = "E-Doc. Read into Draft"::Unspecified then
    EDocument."Read into Draft Impl." := EDocument.GetEDocumentService()."Read into Draft Impl.";

If the service field is also Unspecified, E-Doc. Unspecified Impl. runs and import fails with "No method to read the e-document has been provided." Defaulting to v2 without exposing this field would leave users unable to make v2 work.

What

  • Default new services to Import Process = Version 2.0 (InitValue) and remove Visible = false on the selector.
  • Pin the ForNAV connector service to Version 1.0 at creation (its inbound is not migrated to v2).
  • Add "Read into Draft Impl." to the Purchase Draft group on the service card (shown only for Version 2.0), captioned Draft Format, with a tooltip covering PEPPOL vs. auto-resolved PDF/ADI.
  • Update module docs and add tests: new services default to v2, and the draft format is selectable and persisted for v2.

AB#580191

Magnus Hartvig Grønbech and others added 3 commits July 22, 2026 11:31
…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>
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>
PR #9654 makes the "Import Process" selector visible and defaults new services to Version 2.0, but the V2 import pipeline also needs to know how to read an incoming structured e-document into a draft. That format is the service-level "Read into Draft Impl." field (field 33): for already-structured formats such as PEPPOL XML the structuring step returns Unspecified, so the read step falls back to this field. When it is left Unspecified, "E-Doc. Unspecified Impl." runs and import fails with "No method to read the e-document has been provided."

That field was not on the page, so a user who selected V2 had no way to choose the format. This adds it to the Purchase Draft group (visible for Version 2.0) as "Draft Format", with a tooltip, updates the module docs, and adds a page test verifying the format is selectable and persisted.

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

Copilot-Session: 57f500b9-871d-4cf4-bdc1-751bea22d091
@Groenbech96
Groenbech96 requested a review from a team as a code owner July 23, 2026 16:11
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Integration GitHub request for Integration area labels Jul 23, 2026
@Groenbech96 Groenbech96 changed the title Let users select the V2 draft format on the E-Document Service card Default new E-Document services to import v2 and let users select the draft format Jul 24, 2026
@Groenbech96
Groenbech96 changed the base branch from edoc-v2-default to main July 24, 2026 06:51
@Groenbech96
Groenbech96 requested a review from a team July 24, 2026 06:51
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 24, 2026
@Groenbech96
Groenbech96 added this pull request to the merge queue Jul 24, 2026
Merged via the queue into main with commit acaac80 Jul 24, 2026
336 of 342 checks passed
@Groenbech96
Groenbech96 deleted the edoc-v2-read-into-draft branch July 24, 2026 20:39
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.

3 participants