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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Sub dataitem data not showing up in report

(0) ShareShare
ReportReport
Posted on by 5

Hello,

I will try to be breif. I'm trying to add fields to Checking report no 10401. These fields are from the Bank Account table and are as follows

Last Check No.

Bank Branch No.

Bank Account No.

Here is the code

       dataitem(GenJnlLine; "Gen. Journal Line")
        {
            DataItemTableView = SORTING("Journal Template Name", "Journal Batch Name", "Posting Date", "Document No.");
            column(GenJnlLine_Journal_Template_Name; "Journal Template Name")
            {
            }
            column(GenJnlLine_Journal_Batch_Name; "Journal Batch Name")
            {
            }
            column(GenJnlLine_Line_No_; "Line No.")
            {
            }
            dataitem(BankAccount; "Bank Account")
            {
                DataItemLink = "No." = field("Bal. Account No.");
                DataItemLinkReference = GenJnlLine;
                DataItemTableView = sorting("No.");

                column(Balance_Last_Check_No_; "Last Check No.")
                {
                }
                column(Balance_Bank_Branch_No_; "Bank Branch No.")
                {
                }
                column(Balance_Bank_Account_No_; "Bank Account No.")
                {
                }
Unfortunately, this does not work. The data that is there is simply not displayed.
The only thing I can think of is that the Bal. Account No changes depending on the Bal. Account Type and this is why it is not working.
Thanks in advance for your help.
I have the same question (0)
  • Verified answer
    THE Italian Profile Picture
    on at

    What I would do is not to use another dataitem but use a record variable instead. 

    Use 3 globals> lastCheckNo, bankBranchNo, bankAccountNo

    In the onaftergetrecord of the previous dataitem you could do something like IF BankAccount.GET THEN.. assign values to the globals ELSE blank them

    In the column use the globals instead.. 

  • Suggested answer
    Community Member Profile Picture
    on at

    first of all, the filter has not been set correctly. add Bank account type filter with Bal. Account type Bank.

    the easiest way to make sure that it works right is to put a message code after getting record under bank Account to make sure it takes the bank account record

  • slehoux Profile Picture
    5 on at

    Thank you. This did the trick!

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 2,135

#2
YUN ZHU Profile Picture

YUN ZHU 733 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 612

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans