web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

No looping in a report AL

(0) ShareShare
ReportReport
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;

I have the same question (0)
  • Romryan Profile Picture
    on at
    RE: No looping in a report AL

    any suggestion?

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator 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.");
          
          

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans