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

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
    61 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
    2,524 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
    95,763 Super User 2025 Season 2 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

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 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans