Creating the Playlist Subpage

As of the time of writing this book, Microsoft still insists on referring to Subpages with the obsolete term Subform, a leftover from the Classic version of NAV. We will use the more accurate Subpage term but, as of this writing, your Development Environment objects will still sadly read "Subform".

In Chapter 2, Tables, a homework assignment was to create Page 50003 Playlist Document. We should have used the Page Wizard to create that page, giving us something like this:

Another necessary part of a Document page is the Subpage. Our Subpage can be created using the Page Wizard to create a ListPart based on Table 50003 Playlist Line. After we Finish the Wizard, we'll save and compile the page as 50004 Playlist Subpage. The result will look like the following screenshot (in which you can see the obsolete Subform identification):

To make the document work the way we are used to having NAV Document forms work, we will need to set some properties for this new page. See the bolded properties circled in the following screenshot:

We have set the DelayedInsert and AutoSplitKey properties all to Yes. These settings will allow the Playlist Lines to not be saved until the primary key fields are all entered (DelayedInsert) and will support the easy insertion of new entries between two existing lines (AutoSplitKey).

Finally, we will need to connect our new Playlist Subpage Listpart Page 50004 to the Playlist Document Page 50003 to give us a basic and complete document page. All we need to do to accomplish that is add a new Part line to Page 50003 as shown in the following screenshot:

Entering the PagePartID property in the Part line properties, as shown in the following screenshot, will populate the Name and Caption fields, as shown in the preceding screenshot:

Note the highlighted property, UpdatePropagation, in the preceding screenshot. This property can be set to either SubPart (the default) or Both. This controls how the parent and child pages are updated when a change is made in the data displayed by the child page (the SubPart). If the property value is SubPart, only the child page information display is updated. If the property value is Both, both the child and parent page displays are updated. This is useful when data in the SubPage is updated and the change affects the data displayed in the parent page.

The last step in this phase of our development is to set the Page Part property SubPageLink to automatically filter the contents of the Subpage to only be the lines that are children of the parent record showing in the card-like portion of the Document page (at the top) of the page:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.196.182