GetLongLabel method: Field class
Syntax
GetLongLabel(LabelID)
Description
The GetLongLabel method returns the long name for a field given a label ID. If the given label ID isn’t found, a null string is returned. LabelID takes a string value.
Note:
If a button is defined as an HTML button or hyperlink, and if it has an associated record field, the label associated with it is only the text of the button. The mouse-over text can only be changed by the label if the button is defined as a button with an Image label.
Returns
A text string containing the long name of the field for the specified label ID.
Example
The following code sets the label for a field to one of two different texts, based on the page.
Local Field &FIELD;
&FIELD = GetField(RECORD.MYFIELD);
If %Page = PAGE.PAGE1 Then
&FIELD.Label = &FIELD.GetLongLabel("LABEL1");
Else If %Page = PAGE.PAGE2 Then
&FIELD.Label = &FIELD.GetLongLabel("LABEL2");
End-If;
If the Label ID is the same as the name of the field, you could use the following:
&LABELID = &FIELD.Name;
&FIELD.Label = &FIELD.GetLongLabel(&LABELID);