Skip to content

[29.x]-"The record in table Reminder Line already exists." error appears if you Create Reminders for a Customer with all the Open Entries On Hold and no Reminder Free applied on the Reminder Terms used. - #11209

Open
Fixes4BC (neeleshsinghal) wants to merge 1 commit into
releases/29.xfrom
bugs/Bug-649376-error-appears-if-you-Create-Reminders-for-a-Customer

Conversation

@neeleshsinghal

@neeleshsinghal Fixes4BC (neeleshsinghal) commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#649376

Workitem: Bug 649376: [29.X]-[All-e]"The record in table Reminder Line already exists." error appears if you Create Reminders for a Customer with all the Open Entries On Hold and no Reminder Free applied on the Reminder Terms used.

@neeleshsinghal
Fixes4BC (neeleshsinghal) requested a review from a team September 8, 2026 11:59
@neeleshsinghal
Fixes4BC (neeleshsinghal) requested a review from a team as a code owner September 8, 2026 11:59
@github-actions github-actions Bot added this to the Version 29.1 milestone Sep 8, 2026
@github-actions github-actions Bot added the Team: Finance GitHub request for Finance area label Sep 8, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept with Suggestions

What this PR does

The change updates ending-text line numbering when a reminder has no reminder, additional-fee, or rounding lines. It now starts ending text after existing beginning text instead of from line 0, so InsertBlankLine and InsertTextLines do not reuse the first beginning-text line number.

The branch is targeted. The normal path is unchanged when chargeable reminder lines, an additional fee, or rounding lines exist. In the reported zero-fee and all-on-hold flow, on-hold lines are added after InsertLines, so using the last beginning-text line as the fallback anchor addresses the duplicate key error without changing the later on-hold insertion.

Problem-solution fit

Fit: Strong

The bug describes reminder creation with all entries on hold, beginning and ending texts, and a zero reminder fee. The diff changes the exact empty chargeable-line branch that could otherwise reuse line number 10000, while keeping the existing line-spacing logic for other reminder layouts.

Suggestions

S1 (🟠 Moderate): Add the no-fee text regression test
Please add a test that creates a reminder where all entries are on hold, beginning and ending texts exist, and the reminder fee is 0. This will protect the line-number fallback that now starts ending text after beginning text.

Risk assessment and necessity

Risk: The regression surface is limited to reminder text layout in ReminderCommunication.Codeunit.al and ReminderHeader.InsertTextLines. If this branch is wrong, reminder creation can still fail with duplicate line numbers or place ending text in the wrong position. No public API or event signature changes.

Necessity: The change is needed because the zero-fee and all-on-hold path can block reminder creation before the on-hold lines are added. The scope is small and matches the line-numbering gap; adding the regression test would make it safer.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11209 round=1 by=alexei-dobriansky at=2026-09-08T14:40:56Z lastSha=f2c43acbd7dffca57d53fd6f633a8b5d3566574f reviewKey=ed695b534484b605b0b0815a8cc71cd52140aa282abf7726e25b5c19edecae0e suggestions=S1@18849e71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants