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

Dynamic values in Report Request page field.

(1) ShareShare
ReportReport
Posted on by 458
Hello Mentor's
 
In a report that i am building
 
i want Dim_Val_Tbl field from report request page to filter dynamically based on validation from Dimension_Filter field from report request page,
 
I tried creating temp table and applying it as table relation but it didn't work, Please some one guide me how can i achieve it.
 
 
    requestpage
    {
        AboutTitle = 'Filter';
        AboutText = 'Selet Filters to be applied';
        layout
        {
            area(Content)
            {
                group("Date Filter")
                {
                    field(From_Date; From_Date) { ShowMandatory = true; }
                    field(To_Date; To_Date) { ShowMandatory = true; }
                    field(Dimension_Filter; Dimension_Filter) { TableRelation = Dimension; }
                    field(Dim_Val_Tbl; Dimension_Val_Filter) { TableRelation = "Dimension Value"; }
                }
 
            }
 
        }
 
    }
 
    var
        From_Date: Date;
        To_Date: Date;
        Dimension_Filter: Code[20];
        Dimension_Val_Filter: Code[20];
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,750 Super User 2025 Season 2 on at
    Hi, sorry, I don't understand your purpose. Generally, you can use the field's trigger OnValidate() to do this, for example:
     
    Thanks
    ZHU
  • Suggested answer
    Suresh Kulla Profile Picture
    50,247 Super User 2025 Season 2 on at
    As ZHU mentioned you can just use the standard OnValidate Trigger for the field and check that value and populate the value in other fields, see the below example
     
     
     
  • One And Only Naveen Profile Picture
    458 on at
    @YUN ZHU & @Suresh Kulla Than you for your response.
     
    @YUN ZHU Sir, thanks for your time & suggestion,
     
    In my report request page, I have added a field named Dimension_Filter which gets its values from Dimension Table (by Table Relation property),
     
    I want another field (Dimension_Val_Filter) which should Show all Dimension values associated with Selected Dimension Value in a dropdown style.
     
    When I am applying Table Relation property in Dimension_Val_Filter Field it is showing all the dimension values, I want them to filter it based on Dimension_Filter field,
     
    If this is not possible then what could be workaround. (And i don't have these values in my data item).
  • Verified answer
    Kamal Khakhkhar Profile Picture
    1,337 on at
    Hii there,
     
    As per requirement you can create a lookup in that after you can get the value of dimension code. Then in lookup you can apply setrange and update the filter as per dimension code. And through lookup you can get the value.
     
    Sample code.
     
    Dimvalue.setrange("dimension code","dimension"); If page.runmodel (page::"dimension values", dimvalue)=action:: lookupok then
     
    Dimension filter:=dimvalue.code
     
    As per above sample code it will work. Checked in my local.
     
    Mark as answered if you found answer.
     
    Thank You.
     
    Kamal Khakhkhar
  • Verified answer
    One And Only Naveen Profile Picture
    458 on at
    Thank you guys for helping, As suggested by @Kamal Khakhkhar
    below is my implimentation -
    field(Dim_Val_Tbl; Dimension_Val_Filter)
                        {
                            Caption = 'Select Dimension Value';
                            ApplicationArea = all;
                            TableRelation = "Dimension Value".Code;
                            Lookup = true;
                            trigger OnLookup(var text: Text): Boolean
                            var
                                DimensionValue: Record "Dimension Value";
                                DimensionValuesPage: Page "Dimension Value List";
                            begin
                                DimensionValue.SetRange("Dimension Code", Dimension_Filter);
                                DimensionValue.SetRange("Dimension Value Type", 0);
                                if DimensionValue.FindSet() then begin
                                    DimensionValuesPage.LOOKUPMODE := true;
                                    DimensionValuesPage.SetTableView(DimensionValue);
                                    if DimensionValuesPage.RunModal() = ACTION::LookupOK then begin
                                        DimensionValuesPage.GetRecord(DimensionValue);
                                        Dimension_Val_Filter := DimensionValue.Code;
                                    end;
                                end;
                            end;
                        }

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

#2
YUN ZHU Profile Picture

YUN ZHU 663 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 515

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans