Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

No looping in a report AL

Posted on by

Am customizing BankAcc Detail Trial Balance,I just want to include a field for source number i.e. if source type is customer then the source number is the customer number.
I have started my coding on trigger OnAfterGetRecord() inside dataitem Bank Account Ledger Entry and ofcourse to get the source number and source type I have considered Bank Account Ledger Entry dataitem and GLEntry table.

For a start, I have my code extract below. The problem I have that's preventing me from proceeding, is my report is only displaying one record/document/transaction and hence the message to display entry no is appearing once displaying the one record shown on report.

I had forethought that the report will display all transactions and the message will keep on displaying the entry no until the last transaction shown on the report is reached.

I have tried to use even FindFirst() but still proving futile.
What could be the problem with my code below? why am not getting all the transactions such that the message will pop us per transaction?

If SourceName = '' then
"Bank Account Ledger Entry".Reset();
"Bank Account Ledger Entry".SetRange("Entry No.","Entry No.");
If "Bank Account Ledger Entry".FindSet() then begin
Message('%1',"Bank Account Ledger Entry"."Entry No.");
end;

Categories:
  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: No looping in a report AL

    Hi,

    Can you try this?

    If SourceName = '' then
        if "Bank Account Ledger Entry".get("Entry No.");
          Message('%1',"Bank Account Ledger Entry"."Entry No.");
          
          

  • Romryan Profile Picture
    Romryan on at
    RE: No looping in a report AL

    any suggestion?

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.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,113 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans