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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Table relation in request page of report

(4) ShareShare
ReportReport
Posted on by 234
I have a report where user has to fill in the type of account say bank,vendor,employee,G/L account etc on the request pge and according to that the table realtion for the next field account no. should be there but I am unable to set it.For setting conditional table relation ,it is not letting me use ACCtype variable,How can i do it or any other approcah for the same that anyone can think of.
 
requestpage
    {
        SaveValues = true;
 
        layout
        {
            area(content)
            {
                group(GroupName)
                {
 
                    field(AccType; AccType)
                    {
                       
                    }
                   
                    field(AccNo;AccNo)
                    {
                        TableRelation = if (acctype = filter(Vendor)) Vendor
                    }
                   
                   
 
                }
            }
I have the same question (0)
  • Suggested answer
    Gerardo Rentería García Profile Picture
    27,310 Most Valuable Professional on at
    Hi
    I hope this can help you. and give you some hints. 
    BR
    GR
  • Suggested answer
    YUN ZHU Profile Picture
    102,054 Super User 2026 Season 1 on at
    What report is this?
    Generally, AccType and AccNo variables need to be redeclared unless they are marked as Protected Variable in the standard
    More details: Dynamics 365 Business Central: Can we access global variables from page extensions or table extensions? Yes, But……
     
     
    Thanks.
    ZHU
  • Suggested answer
    David Pezzoli Profile Picture
    14 on at
    Table  relation is available using these request properties:
    SourceTable = "Gen. Journal Line";
    SourceTableTemporary = true;
    for example:
     
    Report 51000 "ReportTest"
    {
        Caption = 'Report Test';
        ProcessingOnly = true;
        
        dataset
        {
        }
        requestpage
        {
            SourceTable = "Gen. Journal Line";
            SourceTableTemporary = true;
            layout
            {
                area(Content)
                {
                    group("Account Setup")
                    {
                        field(AccountType; Rec."Account Type")
                        {
                            ApplicationArea = All;
                            ShowMandatory = true;
                            NotBlank = true;
                            Caption = 'Account Type';
                            ToolTip = 'Specifies the Account Type.';
                        }
                        field("Bank Account No."; Rec."Account No.")
                        {
                            ApplicationArea = All;
                            ShowMandatory = true;
                            NotBlank = true;
                            Caption = 'Account No.';
                            ToolTip = 'Specifies the Account No.';
                            TableRelation = if ("Account Type" = const("G/L Account")) "G/L Account" where("Account Type" = const(Posting), Blocked = const(false))
                                            else
                                            if ("Account Type" = const(Customer)) Customer
                                            else
                                            if ("Account Type" = const(Vendor)) Vendor
                                            else
                                            if ("Account Type" = const("Bank Account")) "Bank Account"
                                            else
                                            if ("Account Type" = const("Fixed Asset")) "Fixed Asset"
                                            else
                                            if ("Account Type" = const("IC Partner")) "IC Partner"
                                            else
                                            if ("Account Type" = const("Allocation Account")) "Allocation Account"
                                            else
                                            if ("Account Type" = const(Employee)) Employee;
                        }
                        
                    }
                }
            }
            actions
            {
                area(Processing)
                {
    
                }
            }
    
            trigger OnOpenPage()
            begin
                
            end;
    
            trigger OnQueryClosePage(CloseAction: Action): Boolean
            var
    
            begin
    
            end;
        }
    }
    
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    23,034 Super User 2026 Season 1 on at
  • Suggested answer
    Jainam M. Kothari Profile Picture
    17,024 Super User 2026 Season 1 on at
  • Gerardo Rentería García Profile Picture
    27,310 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    Solved: How to pass filter values to a Report Request

    SourceTable property - Business Central | Microsoft Learn

    Best Regards
    Gerardo

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,687 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,041 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 974 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans