web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

How to get filters from page

(0) ShareShare
ReportReport
Posted on by 127

Hello everyone,
I want to change data in VAT Entry table, but I want to change data only on current filtered records. For example: After I filtered vat entries on posting date, document type and any other filter, I want to change data on  only for that filtered records. 
Do you know any way how to get current filters (not selected, just filtered), from page in code? I don't want to limit my code on 1,2,3... filters?
Thank you

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    92,073 Super User 2025 Season 2 on at
    RE: How to get filters from page

    Hi, hope the following helps.

    How to get a filter for the selected records on any page (For example, ‘1..3|6’)

    https://yzhums.com/27561/

    Thanks.

    ZHU

  • Suggested answer
    Bilal Haider Profile Picture
    408 on at
    RE: How to get filters from page

    Hi,

    As I understand you want to get the filters from current page.

    There are two functions that you can use.

    Rec.GetFilter(Field)

    It returns the filter string on the field you mentioned.

    Rec.GetFilters

    It returns all the filters. with the field names

    For details

    learn.microsoft.com/.../getfilters-function--record-

  • Haris Korac Profile Picture
    127 on at
    RE: How to get filters from page

    Hello,

    Posting date only just example.

    I create this action:

    trigger OnAction()

    var

         VATEntry: Record "VAT Entry";

         ChangeDATA: Codeunit ChangeDATA_VSL;

    begin

         VATEntry := Rec;

         Clear(VATEntry);

         CurrPage.SetSelectionFilter(VATEntry);

         if VATEntry.FindSet() then

               repeat

                     ChangeDATA.setBaseandOtherFields_VSL(VATEntry);

               until VATEntry.Next() = 0;

    end;

    But I don't want to use selection filter. I want to use filters from page. Is that possible?

  • Suggested answer
    Nitin Verma Profile Picture
    21,666 Moderator on at
    RE: How to get filters from page

    Hi,

    its not recommended to change anything on Posted data, but yes if you want to, you can create a Processing only report, provide the filters in there and write the logic to change the data, if you allowed to.

    Thanks.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,878

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,390

#3
Sumit Singh Profile Picture

Sumit Singh 2,884

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans