Skip to content

Commit 9546e20

Browse files
Magnus Hartvig Grønbechclaude
andcommitted
Fix inverted logic in AllowCreateEDocument guard
The return values were swapped — normal posting (no flags) returned false (blocking creation) while deferred scenarios returned true (allowing it). Swap exit values so normal posting allows inline creation and suppressed flows correctly defer to OnAfterPostWhseActivityCompleted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c6c77d4 commit 9546e20

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Apps/W1/EDocument/App/src/Processing/EDocumentSubscribers.Codeunit.al

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,14 +674,14 @@ codeunit 6103 "E-Document Subscribers"
674674
DeferredCreationLbl: Label 'E-Document creation deferred', Locked = true;
675675
begin
676676
if not (CommitIsSuppressed or InvtPickPutaway or PreviewMode) then
677-
exit(false);
677+
exit(true);
678678

679679
TelemetryDimensions.Add('Source', SourceEvent);
680680
TelemetryDimensions.Add('PreviewMode', Format(PreviewMode));
681681
TelemetryDimensions.Add('InvtPickPutaway', Format(InvtPickPutaway));
682682
TelemetryDimensions.Add('CommitIsSuppressed', Format(CommitIsSuppressed));
683-
Telemetry.LogMessage('', DeferredCreationLbl, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::All, TelemetryDimensions);
684-
exit(true);
683+
Telemetry.LogMessage('0000SIG', DeferredCreationLbl, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::All, TelemetryDimensions);
684+
exit(false);
685685
end;
686686

687687
local procedure LogAfterValidate(EDocumentEntryNo: Integer; LineSystemId: Guid; FieldName: Text)

0 commit comments

Comments
 (0)