Skip to main content
Post a question

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

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

Like (0) ShareShare
ReportReport
Posted on 30 Jan 2025 06:37:31 by 2,558
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
  • Suggested answer
    Bilal Haider Profile Picture
    Bilal Haider 161 on 30 Jan 2025 at 10:42:42
    AL Code Pass Filter from parent (header) to lines (subpage) before entering lines
    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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,234 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,994 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans