SetLabel method: FieldDefn class
Syntax
SetLabel(Label_ID,Long_name,Short_name,Default_label)
Description
Use this method to add a new label or modify an existing label. At least one label is required for the field definition to be saved. Also, one label is required to be set as the default label for the field definition to be saved.
Parameters
| Parameter | Description |
|---|---|
|
Label_ID |
Specifies the label as string. |
|
Long_name |
Specifies the long name of the field as string. |
|
Short_name |
Specifies the short name of the field as string. |
|
Default_label |
Specify a Boolean value whether the label entered in the Label_ID parameter is the default label or not. |
Returns
An integer representing the following statuses.
| Numeric Value | Constant Value | Description |
|---|---|---|
|
0 |
%MDA_Success |
The label for the field is updated successfully. |
|
1 |
%MDA_Failed |
The label for the field is not updated. |
Example
Local FieldDefn &newField = CreateFieldDefn();
If All(&newField) Then
&newField.Name = "MYNEWFIELD";
&newField.Type = %FieldType_Char;
&newField.Description = "My new field";
&retVal = &newField.SetLabel("MYNEWFIELD", "My field", "My New Field", True);
/* do error checking … */
&retVal = &newField.Save();
/* do error checking … */
End-If;