Hi everyone,
I hope you're all doing well!
I'm currently working on a custom document type page to maintain Post Dated Cheque (PDC) records in Business Central. In this setup, users can enter multiple lines under a single PDC document.
Now, I want to transfer these multiple line entries to the respective journals—either the Cash Receipt Journal or the Payment Journal—but instead of creating separate entries for each line, I would like to consolidate them into a single journal line, similar to how the "Apply Entries" functionality works in standard processes.
Has anyone implemented something similar or could point me in the right direction on how best to achieve this? Any suggestions, best practices, or code examples would be greatly appreciated.
Thanks in advance for your support!
Best regards,
Govind Sharma
I believe you've posted this same question twice. If that's the case, please remove one of them to avoid duplication and help keep the thread clean.
✅ Mark this answer as verified if it helps you.
Hi,
Consolidating PDC lines into a single journal entry can significantly improve both operational clarity and downstream posting efficiency. The goal to replicate “Apply Entries”-like behavior makes perfect sense, especially when you're dealing with grouped financial flows like cheque batches.
Here's a streamlined approach:
PDC Line
Customer No.
Document Date
Currency Code
Amount
Gen. Journal Line
Account Type
Account No.
Posting Date
PDC Ref. No.
al procedure InsertConsolidatedJournal(PDCHeader: Record "PDC Header") var PDCLines: Record "PDC Line"; GenJnlLine: Record "Gen. Journal Line"; TotalAmt: Decimal; begin PDCLines.SetRange("Document No.", PDCHeader."No."); if PDCLines.FindSet() then begin repeat TotalAmt += PDCLines.Amount; until PDCLines.Next() = 0; GenJnlLine.Init(); GenJnlLine."Journal Template Name" := 'CASHRECPT'; GenJnlLine."Journal Batch Name" := 'DEFAULT'; GenJnlLine."Posting Date" := PDCHeader."Posting Date"; GenJnlLine."Document No." := PDCHeader."No."; GenJnlLine."Account Type" := GenJnlLine."Account Type"::Customer; GenJnlLine."Account No." := PDCHeader."Account No."; GenJnlLine."Bal. Account Type" := GenJnlLine."Bal. Account Type"::Bank; GenJnlLine."Bal. Account No." := PDCHeader."Bank Account No."; GenJnlLine.Amount := TotalAmt; GenJnlLine.Insert(); end; end;
To align closer with “Apply Entries” logic, you could reference individual line entries using a dimension or custom field for linkage, without cluttering the journal itself. If needed, you can also trigger a notification or review flow before posting. Helpful Reference How to Avoid the "You cannot set Applies-to ID while selecting Applies-to Doc. No." Error in Dynamics 365 BC | Stoneridge Software
If you find this helpful, feel free to mark this as the suggested or verified answer. Cheers Jeffrey
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Sumit Singh 2,056
YUN ZHU 1,680 Super User 2025 Season 2
Rishabh Kanaskar 1,679