SetLabel function
Syntax
SetLabel(scrollpath, target_row, [recordname.]fieldname, new_label_text)
Where scrollpath is:
[RECORD.level1_recname, level1_row, [RECORD.level2_recname, level2_row, ]] RECORD.target_recname
To prevent ambiguous references, you can use SCROLL. scrollname, where scrollname is the same as the scroll level’s primary record name.
Description
Use the SetLabel function to change the label text of a page field or grid column heading.
Note:
This function remains for backward compatibility only. Use the Label field property instead.
You can't use this function to set labels longer than 100 characters. If you try to set a label of more than 100 characters, the label is truncated to 100 characters.
Parameters
| Parameter | Description |
|---|---|
|
scrollpath |
A construction that specifies a scroll level in the component buffer. |
|
target_row |
The row number of the target row. |
|
[recordname .]fieldname |
The name of the field with the associated label text. The field can be on scroll level one, two, or three of the active page. The recordname prefix is required if the function call is not on the record definition recordname. |
|
new_label_text |
A String value specifying the new value for the field or grid column label. |
Returns
Optionally returns a Boolean value indicating whether the function completed successfully.
Example
If training_loc = "HAW" then
SetLabel(voucher_tbl.training_loc, "Hawaii Training Center");
End-if;
Related Topics
- PeopleCode API Reference: Label property: Field class
- PeopleCode API Reference: GetLongLabel method: Field class
- PeopleCode API Reference: GetShortLabel method: Field class
- PeopleCode Developer’s Guide: Understanding Data Buffer Access
- PeopleCode Developer’s Guide: Specifying Data with References Using Scroll Path Syntax and Dot Notation