Update Sub-form (Sub-Page) from Main Page to apply Filters. | CloudFronts

Update Sub-form (Sub-Page) from Main Page to apply Filters.

Problem Statement:

I have a requirement where I want to update the Subform(Part page) from the Main page, this Subpage(Subform) is linked to the Main page by SubpageLink Property. The Subpage is a List page and I want to filter this list by a field from Main Page.

Pre-requisites:

  • VS Code
  • AL Language Extension
  • Microsoft Dynamics NAV /  Business Central

Solution:

To solve the above Problem statement we have to make use of the Currpage.Update() function which shall update the Subpage.

As you can see in the below window a function is created Vendorfilter() on Subpage with the “vendor” parameter, in this function filter is added for the vendor on the part page and then CurrPage.Update() is used. This function will update the Subpage with the vendor.

Now, call this function on “OnValidate” trigger of the Main page field, here we have “Vendor” field on Main Page.

 

 

The calling of Function is as follows:

CurrPage.<SubpageName>.Page.<FunctionName>(Rec.<FieldName>);

In this example we have

CurrPage.POLines.page.Vendorfilter(Rec.Vendor);

Conclusion: Thus we can achieve updating a Subform from a Main Page.

Hope this helps!


Share Story :

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close