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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Currpage.settableview not working in onaftergetrecord trigger when switching between pages

(8) ShareShare
ReportReport
Posted on by 16
I have this custom functionality added on warehouse pick sub-form level in OnAfterGetRecord trigger to filter the lines in sub-form and display only those line whose bin No. is assigned to the current user. I am performing this filtering base on a boolean field on the header level such that if the field is true then filter the lines and vice versa. The trigger and the filtering is working perfectly fine but when I switch pages and use the back arrow to navigate to the previous pick then the trigger somehow isn't executed and the pick sub-form displays no lines even when there are lines present in the table. Now I have figured the only line causing this weird scenario is the Currpage.settableview which if I comment out and then navigate through the pages, the actual lines in the sub-form would show without the filtering since the filtered table view wont be set. The issue here is the trigger not executing properly due this one line when pages are switched so kindly help me figure a work around this one.
//
//
//
//
//
I have the same question (0)
  • Suggested answer
    Nour_K Profile Picture
    67 on at
    what if you add currPage.Update?
    Or if you call the filtering function from the Whse Pick Header page with CurrPage.Update()?
  • Suggested answer
    Aman Kakkar Profile Picture
    3,465 Super User 2026 Season 1 on at
    Hi,
     
    Last time when I got stuck in this kind of situation, what I did was - NOT used OnAfterGetRecord trigger in the subform itself. Instead I created a procedure in the Subform for the filtering part and applied filters directly on the Rec.
     
    And then called this procedure from the Header's OnAfterGetCurrRecord procedure (you can try with OnAfterGetRecord or whichever trigger works for you). 
     
    This way your code won't break. Do remember to add CurrPage.Update at the end of your procedure in the subform to see realtime filterings.
     
    Hope this helps,
    Aman K
  • Suggested answer
    YUN ZHU Profile Picture
    100,629 Super User 2026 Season 1 on at
    Hi, hope the following can give you some hints.
    Dynamics 365 Business Central: Switching a page to non-editable in real time via a field value
     
    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,036 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,179 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 828

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans