SetDBFieldLabel function

Syntax

SetDBFieldLabel(Field.FieldName, LabelID, Long, Short, Default [, LanguageID])

Description

Use the SetDBFieldLabel function to either modify an existing label, or add a new label to a field definition.

Parameters

Parameter Description

FieldName

Specify the name of the field that you want to modify. This name must be prefixed by the reserved word Field.

LabelID

Specify the label ID of the field label that you want to modify as a string. If the specified label ID isn't found, a new label, with the specified label ID, is created for the field.

Long

Specify the new long label for the field as a string.

Short

Specify the new short label for the field as a string.

Default

Specify whether the new label is the default label for the field. This parameter takes a Boolean value: True, set the label as the default, False, do not.

LanguageID

Specify the three character language code to use with this field. This parameter is optional. If you do not specify a language code, the language of the current user is used.

Returns

A constant value. The values are:

Value Description

%MDA_Success

Function completed successfully.

%MDA_Failure

Function didn't complete successfully.

%MDA_FieldNotFound

The specified field wasn't found.

Example

&ret = SetDBFieldLabel(Field.OrgId, "ORGID", "Organization ID", "OrgId", True);  
If (&ret = %MDA_Success) Then 
   MessageBox(0, "Metadata Fn Status", 0, 0, "SetDBFieldLabel succeeded"); 
Else 
   MessageBox(0, "Metadata Fn Status", 0, 0, "SetDBFieldLabel failed"); 
End-If;

Considerations Using this Function

This function is intended for use during configuration time only, before active runtime usage is initiated. Using this function during active runtime is not supported. Changes to data definitions are not recognized on currently loaded component. In general, changes aren't recognized until the component is reloaded.

WARNING:

These operations take place in a separate transaction from the page's save status: the initiation of any of these operations immediately changes the definitions, even if the page is subsequently cancelled.