Label property: Field class
Description
Use this property to override the label text for the field when it’s displayed on a page.
Important:
Even if the label text has been set in Application Designer, this property returns a blank string if you use the property before you’ve explicitly set it in PeopleCode. This property overrides the existing value only. When a user navigates away from the component, and then back to the page again, the original value is used until it's changed again through PeopleCode.
To set the label in PeopleCode, use this property or the SetLabel built-in function. To return the text of a label before you set it, use the GetShortLabel or GetLongLabel methods.
Note:
You can't use this property 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.
The “tool tip,” or mouse over text, that appears with a hyperlink at runtime comes from the RFT long label assigned to the record field. However, the RFT long label displays only if it is different from the assigned display value of the hyperlink and it is not null. If the link is an image button, the tool tip is derived from the label text if there is any. Otherwise, the RFT long label is used.
This property is read/write.
Example
The following code sample changes all the field labels for a record to the short label. It assumes that there is a label with the same name as the name of the field for all fields in the record.
Local Field &FLD;
Local Record &REC;
If CHECK_FIELD Then
&REC = GetRecord();
For &I = 1 to &REC.FieldCount
&FLD = &REC.GetField(&I);
&LABELID = &FLD.Name;
&FLD.Label = &FLD.GetShortLabel(&LABELID);
End-For;
End-If;