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...
Suggested Answer

How to get filters from page

(0) ShareShare
ReportReport
Posted on by 142

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
    Nitin Verma Profile Picture
    21,698 Moderator on at

    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.

  • Haris Korac Profile Picture
    142 on at

    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
    Bilal Haider Profile Picture
    412 on at

    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-

  • Suggested answer
    YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at

    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

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 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans