Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

Adding reset button in page?

Posted on by 75

5584.date-is-created-and-to.png

Here I have a system page where I need to add reset button, to reset my page.

Can I add reset button in my page in Al code?

If it's possible please suggest how? Is there any method can I reset the page 

This is code:

    actions

    {

        area(Processing)

        {

            action("Open Enquiries Filter Page")

            {

                Caption = 'Open Enquiries Filter Page';

                ApplicationArea = All;

                Promoted = true;

                PromotedCategory = Process;

                PromotedIsBig = true;

                trigger OnAction()

                var

                    varFilterPageBuilder: FilterPageBuilder;

                    Enquiries: Record Enquiries;

                    FilterExpr: text;

                    recEnquiries: Record Enquiries;

                    Past3Months: Date;

                    varDefaultView: Text;

                    varDateItem: Text[30];

                    cdu_FilterTokens: Codeunit "Filter Tokens";

                begin

                    Enquiries.Reset();

                    varFilterPageBuilder.AddTable('Enquiries', Database::Enquiries);

                    varFilterPageBuilder.AddField('Enquiries', Rec.No);

                    varFilterPageBuilder.AddField('Enquiries', Rec.Status);

                    varFilterPageBuilder.AddField('Enquiries', Rec.Email);

                    varFilterPageBuilder.AddField('Enquiries', Rec.Contact);

                    varFilterPageBuilder.AddField('Enquiries', recEnquiries.DateCreated);

                    varFilterPageBuilder.AddField('Enquiries', recEnquiries.DateCreated);

                    varFilterPageBuilder.PageCaption := 'Enquiries Filter Page';

                    if varFilterPageBuilder.RunModal() then begin

                        Enquiries.SetFilter(DateCreated, DateCreate);

                        Enquiries.SetFilter(DateCreatedTo, DateCreateTo);

                        if Enquiries.FindSet() then begin

                            Enquiries.SetView(varFilterPageBuilder.GetView('Enquiries'));

                            CurrPage.SetTableView(Enquiries);      

                        end;

                    end;

                end;

            }

        }

    }

    var 

      DateCreate: Text;

        DateCreateTo: Text;

}

  • Shankar Profile Picture
    Shankar 75 on at
    RE: Adding reset button in page?

    Ok Thankyou, got it closing my thread now.

  • Verified answer
    Govinda Kumar Profile Picture
    Govinda Kumar 2,203 Super User 2024 Season 1 on at
    RE: Adding reset button in page?

    Your FilterPageBuilder is opened from the action itself, and its a filter page you cannot add an action to it as Tech Lucky mentioned.

  • Verified answer
    Tech-Lucky Profile Picture
    Tech-Lucky 796 on at
    RE: Adding reset button in page?

    as this is just a filter page you can not add actions to this

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,232 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,064 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans