GetPageField function
Syntax
GetPageField(Page.PAGE_NAME, [scrollpath. [target_row, ]] PAGEFIELD_NAME)
In which scrollpath is:
[Record.level1_recname, level1_row, [Record.level2_recname, level2_row, ]] Record.target_recname
To prevent ambiguous references, you can use Scroll. scrollname, in which scrollname is the same as the scroll level’s primary record name.
Description
Use the GetPageField function to reference a specific instance of a record field on any page in the current component. Typically, you use GetPageField to reference radio buttons, which represent multiple instances of a record field. While the GetField function uses the record field name as an argument, GetPageField uses the page field name instead, which can be uniquely defined for each instance. Regardless, GetPageField still requires that the page field be associated with a record field.
Note:
The page field name is the name specified on the General tab for the page field properties in the page definition in Application Designer.
Parameters
| Parameter | Description |
|---|---|
|
PAGE_NAME |
The name of the page specified in the page definition, preceded by the keyword Page. The PAGE_NAME page must be in the current component. Note: The %Page system variable refers to the current page only, and therefore cannot be used to refer to a record field on any page in the current component. |
|
scrollpath |
A construction that specifies a scroll level in the component buffer. This parameter is optional. The default is the current scroll. |
|
target_row |
The row number of the row in which the field occurs. This parameter is optional. The default is the current row. |
|
PAGEFIELD_NAME |
The name of the page field specified in the page field properties in the page definition. |
Returns
A Field object.
Example
The following example initializes four Field objects to four distinct radio button page fields and conditionally sets their labels to either a long version or a short version.
Local Field &Fld1, &Fld2, &Fld3, &Fld4;
&Fld1 = GetPageField(Page.GNNWG_PAGE, "INITIALIZE"); /* Initialize Radio Button */
&Fld2 = GetPageField(Page.GNNWG_PAGE, "COMMIT"); /* Commit Radio Button */
&Fld3 = GetPageField(Page.GNNWG_PAGE, "ROLLBACK"); /* Rollback Radio Button */
&Fld4 = GetPageField(Page.GNNWG_PAGE, "SAMFAIL"); /* SAMFAIL Radio Button */
If &label_type = "Long" Then
&Fld1.Label = "Initialize_Long_Label_Name";
&Fld2.Label = "Commit_Long_Label_Name";
&Fld3.Label = "Rollback_Long_Label_Name";
&Fld4.Label = "SAMFAIL_Long_Label_Name";
Else
&Fld1.Label = "Initialize";
&Fld2.Label = "Commit";
&Fld3.Label = "Rollback";
&Fld4.Label = "SAMFAIL";
End-If;