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...
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
    25,390 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
    95,763 Super User 2025 Season 2 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
    20,962 Super User 2025 Season 2 on at
  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,639 Super User 2025 Season 2 on at
  • Gerardo Rentería García Profile Picture
    25,390 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

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,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans