Skip to main content

Notifications

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 138
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];
  • Verified answer
    One And Only Naveen Profile Picture
    138 on at
    Dynamic values in Report Request page field.
    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;
                        }
  • Verified answer
    Kamal Khakhkhar Profile Picture
    366 on at
    Dynamic values in Report Request page field.
    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
  • One And Only Naveen Profile Picture
    138 on at
    Dynamic values in Report Request page field.
    @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).
  • Suggested answer
    Suresh Kulla Profile Picture
    45,771 on at
    Dynamic values in Report Request page field.
    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
     
     
     
  • Suggested answer
    YUN ZHU Profile Picture
    79,578 Super User 2025 Season 1 on at
    Dynamic values in Report Request page field.
    Hi, sorry, I don't understand your purpose. Generally, you can use the field's trigger OnValidate() to do this, for example:
     
    Thanks
    ZHU

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,304 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,133 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans