Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ page 6122 "E-Documents"
AdditionalSearchTerms = 'Edoc,Electronic Document,EDocuments,E Documents,E invoices,Einvoices,Electronic';
RefreshOnActivate = true;
Editable = false;
DeleteAllowed = false;
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.

$\textbf{🟠\ High\ Severity\ —\ Security} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

List page now allows deleting e-documents

The general E-Documents list page (covering both inbound and outbound) now permits deletion. The table-level OnDelete guard blocks Status=Processed records and linked records, but documents with service-level status 'Sent', 'Approved', or 'Pending Response' whose main status is still 'In Progress' can be deleted, potentially destroying audit trail evidence required by e-invoicing regulations (e.g., Peppol, EU VAT Directive) in many jurisdictions.

Recommendation:

  • If deletion is intentional for error-state or duplicate documents only, restrict it via an OnDeleteRecord page trigger that enforces the same service-status checks as recommended for the Outbound page, rather than relying solely on the table trigger.
Suggested change
DeleteAllowed = false;
// Add an OnDeleteRecord trigger to enforce service-status checks:
trigger OnDeleteRecord(): Boolean
var
EDocumentServiceStatus: Record "E-Document Service Status";
begin
EDocumentServiceStatus := Rec.GetEDocumentServiceStatus();
if EDocumentServiceStatus.Status in [
EDocumentServiceStatus.Status::Sent,
EDocumentServiceStatus.Status::Approved,
EDocumentServiceStatus.Status:"Pending Response"]
then
Error(CannotDeleteTransmittedDocErr);
end;

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

DeleteAllowed = true;
InsertAllowed = false;
SourceTableView = sorting("Entry No") order(descending);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ page 6106 "Outbound E-Documents"
PageType = List;
RefreshOnActivate = true;
Editable = false;
DeleteAllowed = false;
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.

$\textbf{🟠\ High\ Severity\ —\ Security} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

Deletion enabled for sent outbound e-documents

Changing DeleteAllowed to true on the Outbound E-Documents page allows users to delete records of documents that may already have been transmitted to customers or tax authorities (e.g., service status 'Sent', 'Approved', 'Pending Response'). The table-level OnDelete guard only blocks records where main Status = Processed; a document can be 'Sent' at the service level while still having main status 'In Progress', leaving a gap that permits deletion of legally relevant outbound invoices.

Recommendation:

  • Either keep DeleteAllowed = false on the Outbound E-Documents page, or add an OnDeleteRecord trigger that also checks service-level status (Sent, Approved, Pending Response, Cleared) and raises an error before the table delete fires.
Suggested change
DeleteAllowed = false;
trigger OnDeleteRecord(): Boolean
var
EDocumentServiceStatus: Record "E-Document Service Status";
begin
EDocumentServiceStatus := Rec.GetEDocumentServiceStatus();
if EDocumentServiceStatus.Status in [
EDocumentServiceStatus.Status::Sent,
EDocumentServiceStatus.Status::Approved,
EDocumentServiceStatus.Status:"Pending Response",
EDocumentServiceStatus.Status::Cleared]
then
Error(CannotDeleteTransmittedDocErr);
end;

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

DeleteAllowed = true;
InsertAllowed = false;
SourceTableView = sorting("Entry No") order(descending) where(Direction = const(Direction::Outgoing));

Expand Down
Loading