Understanding Subpages

Subpages are a powerful means of factoring out commonly used page functionality in your application. Rather than duplicating the same set of page fields on two or more pages, you can create a single subpage that contains those page fields and then add it to any page. Subpages provide an easy way to maintain the functionality that the page fields represent.

Subpages are even more effective when used with corresponding subrecords. To support the use of subrecords with subpages, the system uses a record name substitution mechanism for subpage-type page fields. Each subpage has a from record that is determined dynamically by the page definition in PeopleSoft Application Designer and by PeopleSoft Pure Internet Architecture. The from record is a record associated with one of the page fields on the subpage. Which page field depends on the page field ordering, the types of page fields on the subpage, and whether the associated record is a subrecord. The subpage itself must be fully expanded to make this determination. (Keep this fact in mind when working with subpages that contain other subpages.)

You specify the to record in the Subpage Record Name Substitution field in the Insert Subpage dialog box that appears after you insert the subpage into a page. (It also appears on the Subpage tab of the Subpage Properties dialog). At runtime, when a subpage-type page field is expanded, each page field that is associated with the dynamically determined from record is instead associated with the to record that you specify. For example, you can populate a subpage with page fields that are associated with a subrecord so that the subrecord is determined to be the from record; then, when that subpage is used as a subpage-type page field, you can specify the to record as one of the records that contains that subrecord. You are able to associate a single set of page fields (through the subpage) with a variety of different records (each containing the subrecord).