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

(2) ShareShare
ReportReport
Posted on by 218
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
                    }
                   
                   
 
                }
            }
  • Suggested answer
    David Pezzoli Profile Picture
    7 on at
    Table relation in request page of report
    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
    YUN ZHU Profile Picture
    79,156 Super User 2025 Season 1 on at
    Table relation in request page of report
    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
    gdrenteria Profile Picture
    15,759 Most Valuable Professional on at
    Table relation in request page of report
    Hi
    I hope this can help you. and give you some hints. 
    BR
    GR

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,265 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,927 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans