Skip to content

Adds E-Document support to digital voucher checks AB#108948#40

Open
AndriusAndrulevicius wants to merge 16 commits into
mainfrom
dev/aan/digitalvoucher
Open

Adds E-Document support to digital voucher checks AB#108948#40
AndriusAndrulevicius wants to merge 16 commits into
mainfrom
dev/aan/digitalvoucher

Conversation

@AndriusAndrulevicius

Copy link
Copy Markdown
Collaborator

Introduces E-Document as a new check type for digital vouchers, enhancing compliance with electronic document management regulations. Updates UI logic and data structures to support automatic generation and linking of purchase documents.

Introduces E-Document as a new check type for digital vouchers, enforcing automatic generation and linking for purchase documents. Updates UI logic to ensure consistent behavior and validation. Extends data structures and event handling to support E-Document attachment and integration with related processes.

Enables more robust compliance with regulatory requirements for electronic document management.
Adds feature flag and setup validations before attaching digital vouchers to documents, ensuring attachments only occur when the functionality is enabled and properly configured. Expands handling for purchase credit memos and improves type checks for both sales and purchase documents.
Streamlines digital voucher validation by generalizing E-Document attachment to support more document types and rely on record references rather than hardcoded field access or document types. Improves maintainability and feature extensibility by extracting document details via a dedicated method and refining permission set object ordering. Enhances code clarity and robustness in preparation for feature expansion.
Introduces comprehensive automated tests covering E-Document attachment behavior for sales and purchase documents, ensuring correct enforcement and attachment logic. Updates dependency declarations for better test isolation, removes unused variables, and improves error checking and file name handling for E-Document processing. Enhances reliability and maintainability of digital voucher and E-Document integration.
Comment thread Apps/W1/EnforcedDigitalVouchers/test/src/EDocAttachmentTests.Codeunit.al Outdated
Comment thread Apps/W1/EnforcedDigitalVouchers/test/src/EDocAttachmentTests.Codeunit.al Outdated
Comment thread Apps/W1/EnforcedDigitalVouchers/test/src/EDocAttachmentTests.Codeunit.al Outdated
Comment thread Apps/W1/EnforcedDigitalVouchers/test/src/EDocAttachmentTests.Codeunit.al Outdated
Comment thread Apps/W1/EnforcedDigitalVouchers/test/app.json Outdated
@GMatuleviciute GMatuleviciute changed the title Adds E-Document support to digital voucher checks Adds E-Document support to digital voucher checks AB#108948 Feb 25, 2026
@GMatuleviciute GMatuleviciute changed the title Adds E-Document support to digital voucher checks AB#108948 Adds E-Document support to digital voucher checks Feb 25, 2026
@GMatuleviciute GMatuleviciute changed the title Adds E-Document support to digital voucher checks Adds E-Document support to digital voucher checks AB#108948 Feb 25, 2026
AndriusAndrulevicius and others added 9 commits March 2, 2026 09:47
…herEntrySetup.Table.al

Co-authored-by: Grasiele Matuleviciute <131970463+GMatuleviciute@users.noreply.github.com>
…herEntrySetup.Table.al

Co-authored-by: Grasiele Matuleviciute <131970463+GMatuleviciute@users.noreply.github.com>
Refactors E-Document file attachment for purchase documents by relocating the logic from the check codeunit to the main implementation codeunit, improving code structure and responsibility separation. Updates test object ranges, enhances test reliability, and adjusts error handling to use labels for better localization. Clarifies and simplifies validation around E-Document requirements and streamlines page variable initialization. Improves maintainability and prepares for future extensibility.
@GMatuleviciute

Copy link
Copy Markdown
Owner

Description:

This pull request does not have a related issue as it's part of the delivery for development agreed directly with <>

Implementation

With this update enhanced automation for Digital Vouchers in sales and purchase document posting. When enabled, the system will automatically generate and attach E-Documents and related files to posted documents, streamlining document management and compliance.

Functional Changes

  1. New Check Type Option
  • The Check Type field in the Digital Voucher Entry Setup table has been extended to include a new option: E-Document.
  • E-Document option is only valid when the Entry Type is set to Sales Document or Purchase Document.
  • The E-Document check type can only be selected when Generate Automatically is set to TRUE.
  1. Automated Document Attachment on Posting

When posting sales or purchase documents, if setup is set to use E-Documents the system will attach related E-Document files to the Incoming Document Files of the posted sales/purchase document.

Impact

  • Reduces manual effort in attaching compliance documents.
  • Ensures all relevant files are consistently linked to posted documents.

AndriusAndrulevicius and others added 3 commits March 23, 2026 11:58
Improves observability by logging errors via feature telemetry when e-document attachment operations fail, including XML extraction from PDFs and incoming document imports. This helps diagnose issues in production without relying solely on user-reported errors.

Refactors a purchase document test helper to separate the case where no e-document link is needed, removing an unnecessary guard condition and simplifying the overload that requires an e-document record.

Also includes minor code style normalizations (variable reordering, lowercase `error()` calls) for consistency.
Replaces dynamic error text and call stack capture in telemetry logging with static, descriptive messages to avoid exposing potentially sensitive runtime details in telemetry.

Reorders permission set entries to group tables, pages, and codeunits together for better readability and consistency.

Also adds missing newlines at end of JSON and table files to follow standard file formatting conventions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants