Skip to content

[Master] - Vendor Subscription Contract Deferral Release fails with “Gen. Journal Template does not exist (Name = '')”#8254

Open
DhavalMore88 wants to merge 1 commit into
microsoft:mainfrom
DhavalMore88:bugs/Bug-636197-Master-Vendor-Subscription-Contract-Deferral-Release-fails
Open

[Master] - Vendor Subscription Contract Deferral Release fails with “Gen. Journal Template does not exist (Name = '')”#8254
DhavalMore88 wants to merge 1 commit into
microsoft:mainfrom
DhavalMore88:bugs/Bug-636197-Master-Vendor-Subscription-Contract-Deferral-Release-fails

Conversation

@DhavalMore88
Copy link
Copy Markdown
Contributor

@DhavalMore88 DhavalMore88 commented May 20, 2026

AB#636197

Bug 636197: [master] [ALL-E] Vendor Subscription Contract Deferral Release fails with “Gen. Journal Template does not exist (Name = '')”

@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 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Issue #636197 is not valid. Please make sure you link an issue that exists, is open and is approved.

@DhavalMore88 DhavalMore88 marked this pull request as ready for review May 20, 2026 20:05
@DhavalMore88 DhavalMore88 requested a review from a team as a code owner May 20, 2026 20:05
@github-actions github-actions Bot added the Linked Issue is linked to a Azure Boards work item label May 20, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Style} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

PostGenJnlLine implicitly depends on prior Get()

ServiceContractSetup is a report-level variable loaded by GetGeneralLedgerSetupAndCheckJournalTemplateAndBatch(), but PostGenJnlLine() uses it directly for Journal Template Name and Journal Batch Name without its own Get() or nil guard. Any caller invoking PostGenJnlLine without first calling GetGeneralLedgerSetupAndCheckJournalTemplateAndBatch will silently post journal entries with blank template and batch names.

Recommendation:

  • Add ServiceContractSetup.Get() at the top of PostGenJnlLine() (or call it from a shared initialization procedure), so the procedure is self-contained and not reliant on implicit call ordering.
procedure PostGenJnlLine(var InputTempGenJournalLine: Record "Gen. Journal Line" temporary; InputPostingDate: Date; SourceCodeSetupContractDeferralsRelease: Code[10])
var
    GenJnlLine: Record "Gen. Journal Line";
begin
    if not ServiceContractSetup.FindFirst() then
        ServiceContractSetup.Get();
    GenJnlLine.Init();
    GenJnlLine."Journal Template Name" := ServiceContractSetup."Def. Rel. Jnl. Template Name";

Line mapping was unavailable, so this was posted as an issue comment.

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant