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 119

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

  • Suggested answer
    YUN ZHU Profile Picture
    81,827 Super User 2025 Season 1 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
    248 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
    119 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,544 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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,281 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,019 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans