microsoft / microsoft/BCApps

[Bug]: codeunit 5510 "Production Journal Mgt" - SetTemplateAndBatchName

Open
#8,273 4 comments 0 reactions 1 assignee View on GitHub

@PredragMaricic is already working on this.

Since Aug 24, 2026.

Team: SCM
Dominant language
AL
Stars
683
Forks
459
Avg merge
3d 26m
Merged PRs (30d)
633

Description

Describe the issue

There is a bug in codeunit 5510 "Production Journal Mgt" in procedure SetTemplateAndBatchName.

        ItemJnlTemplate.SetRange("Page ID", PageID);
        ItemJnlTemplate.SetRange(Recurring, false);
        ItemJnlTemplate.SetRange(Type, PageTemplate);
        if not ItemJnlTemplate.FindFirst() then begin
            ItemJnlTemplate.Init();
            ItemJnlTemplate.Recurring := false;
            ItemJnlTemplate.Validate(Type, PageTemplate);
            ItemJnlTemplate.Validate("Page ID"); // This should validate PageID

When the record is inserted it is missing page id.
The next time the same procedure is called it will still not find the record (because of the filters), but try to insert the same record it has already inserted.

Expected behavior

If a record with the page id is missing, it should insert a record with the same page id, and not 0.

Steps to reproduce

View the example, it's a straight forward issue.

Additional context

No response

I will provide a fix for a bug
  • I will provide a fix for a bug

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.