Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

  • Fix Error Messages FactBox visibility to show when there are errors/warnings
  • Update Finalize action visibility for both "Ready for Draft" and "Draft Ready" states
  • Remove extra reprocessing logic (per code review - underlying system handles this)
  • Add test verifying finalize from Ready for Draft state works correctly
  • Fix AA0175 linting error: use IsEmpty() instead of FindFirst() for existence check

Summary of Changes

This PR fixes UX issues in the e-document draft page (Page 6181 "E-Document Purchase Draft"):

Changes:

  1. Error Messages FactBox visibility (line 275)

    • Changed from Visible = false; to Visible = HasErrorsOrWarnings;
    • Users can now see validation errors in the FactBox
  2. Finalize Action visibility (line 527)

    • Extended to show for both "Ready for Draft" and "Draft Ready" states
    • The underlying system automatically runs the necessary steps
  3. Test added (EDocProcessTest.Codeunit.al)

    • Added FinishDraftFromReadyForDraftStateSucceeds test
    • Verifies that finalize action from "Ready for Draft" state correctly processes to "Processed" state

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Fixes AB#620054

Copilot AI and others added 2 commits January 29, 2026 11:03
…eady for Draft state

Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
… draft

Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix document draft validation issue causing user blockage Fix e-document draft UX: show error factbox and allow finalize from Ready for Draft state Jan 29, 2026
Copilot AI requested a review from Groenbech96 January 29, 2026 11:07
@Groenbech96
Copy link
Contributor

@copilot Dont add the extra reprocessing, as the underlying system will do that already.
The new condition is fine for when to show.

Please add a test that verifies that going from ready for draft, clicking finalize action, will indeed behave as expected.

…for Draft state

Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 29, 2026

@copilot Dont add the extra reprocessing, as the underlying system will do that already.
The new condition is fine for when to show.

...

Removed the extra reprocessing logic and added the test FinishDraftFromReadyForDraftStateSucceeds which verifies that invoking the finalize action from "Ready for Draft" state correctly processes the document to "Processed" state. Commit: 631e3e9

@github-actions github-actions bot added the AL: Apps (W1) Add-on apps for W1 label Jan 29, 2026
@Groenbech96 Groenbech96 added the Linked Issue is linked to a Azure Boards work item label Jan 30, 2026
@github-actions github-actions bot added this to the Version 28.0 milestone Jan 30, 2026
Magnus Hartvig Grønbech added 2 commits January 30, 2026 15:14
@Groenbech96
Copy link
Contributor

@copilot Build: ./src/Apps/W1/EDocument/Test/src/Processing/EDocProcessTest.Codeunit.al#L386
AA0175 Variable 'PurchaseHeader' queries the database in 'FinishDraftFromReadyForDraftStateSucceeds' but does not use the queried record. Only find or get record if you need to access the values. Consider using ISEMPTY.

…nce check

Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 9, 2026

@copilot Build: ./src/Apps/W1/EDocument/Test/src/Processing/EDocProcessTest.Codeunit.al#L386
AA0175 Variable 'PurchaseHea...

Fixed by using IsEmpty() instead of FindFirst() for the existence check. Commit: 007d3c0

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 Linked Issue is linked to a Azure Boards work item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants