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

AL Code Pass Filter from parent (header) to lines (subpage) before entering lines

(0) ShareShare
ReportReport
Posted on by 3,247
Hi All 
I have requirement to add an action to service order subpage to select multiple serv items same as sales order. Only problem is there is an extra filter for the customer as each serv item is assigned to a customer. Now before adding ANY lines you cannot get the customer no from header and as a result the filter doesnt work. Is there any way to get header values BEFORE inserting a line? below we need to filter items by customer no 10000. Only other option is to have the action on header but thought if anyones got ideas
I have the same question (0)
  • Suggested answer
    Bilal Haider Profile Picture
    412 on at
    Hi,
     
    Yes, this is common requirement.
     
    On Subform page / pageext:
     
    You need to add a new global variable on like SOHeaderNo.
     
    Create a setter procedure on subform:
     
    procedure setSOHeaderNo(Code: Code[20])
    begin
     
    SOHeaderNo := Code;
     
    end;
     
    On Main page:
     
    trigger OnAfterGetCurrRecord()
    begin
     
    CurrPage.Subform.PAGE.setSOHeaderNo(Rec.No.);
     
    end;
     
     
     

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