Skip to content

Handle failure to manually create E-Document from posted doc with no …#8183

Open
georgepomazkov wants to merge 3 commits into
microsoft:mainfrom
georgepomazkov:bugs/8181-verify-manual-edoc-creation
Open

Handle failure to manually create E-Document from posted doc with no …#8183
georgepomazkov wants to merge 3 commits into
microsoft:mainfrom
georgepomazkov:bugs/8181-verify-manual-edoc-creation

Conversation

@georgepomazkov
Copy link
Copy Markdown

@georgepomazkov georgepomazkov commented May 18, 2026

Fixes message 'The e-document has been created.' being shown to user when the e-document was not in fact created.

What & why

In cases when the e-document could not be manually created from a posted document page with no explicit error, the system would still tell the user that 'The e-document has been created.'.

The fix implements propagating the result of creating E-Document back to the calling procedure CreateEDocumentFromPostedDocumentPage() which returns true if the e-document was created and false otherwise, in which case message 'The e-document could not be created.' is shown to user.

Linked work

Fixes #8181

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 (required ΓÇö be specific: scenarios, commands, screenshots for UI changes)

Manually tested the case for posted sales invoice described in the issue, the system showed the following message when the e-document was not created due to the document type not being supported by the E-Document Service and no explicit error being thrown.

image

Risk & compatibility

None.

Fixes AB#636180

@georgepomazkov georgepomazkov requested a review from a team as a code owner May 18, 2026 10:14
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork labels May 18, 2026
@georgepomazkov
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@JesperSchulz JesperSchulz added the Integration GitHub request for Integration area label May 18, 2026
JesperSchulz
JesperSchulz previously approved these changes May 18, 2026
Comment thread src/Apps/W1/EDocument/App/src/Processing/EDocumentProcessing.Codeunit.al Outdated
Comment thread src/Apps/W1/EDocument/App/src/Processing/EDocumentProcessing.Codeunit.al Outdated
@Groenbech96 Groenbech96 added the Linked Issue is linked to a Azure Boards work item label May 20, 2026
Copy link
Copy Markdown
Contributor

@Groenbech96 Groenbech96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, otherwise great change.

RunEDocumentCheck(PostedRecord, Enum::"E-Document Processing Phase"::Post);

NoOfExistingEDocuments := this.GetEDocumentCountForDocument(RecordRef);
EDocumentSubscribers.CreateEDocumentFromPostedDocument(PostedRecord, DocumentSendingProfile, DocumentType);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be possible to return a bool from the CreateEDocumentFromPostedDocument.
Then exit(EDocumentSubscribers.CreateEDocumentFromPostedDocument(PostedRecord, DocumentSendingProfile, DocumentType)).

Less load, since we have the information inside the function call.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 149fa44

@github-actions github-actions Bot added this to the Version 29.0 milestone May 20, 2026
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 From Fork Pull request is coming from a fork Integration GitHub request for Integration area Linked Issue is linked to a Azure Boards work item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: [E-Document] The system tells that the e-document has been created from a posted document when it was not actually created

3 participants