[Bug]: codeunit 5510 "Production Journal Mgt" - SetTemplateAndBatchName
Open
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.