SetDBFieldFormatLength function

Syntax

SetDBFieldFormatLength(FieldName, Length)

Description

Use the SetDBFieldFormatLength function to change the format length for a field. This length controls the maximum number of characters an end user can type into an edit box for this character field. This can be used to limit the user without having to rebuild or alter the table.

Note:

This function only works with character fields.

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.

Length

Specify the new format length as a number. Valid values are between 1 and 254.

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 in the database.

%MDA_Unsupported

You tried to use this function on a non character field. This function is only supported on character fields.

Example

&ret =  SetDBFieldFormatLength(FIELD.OrgId, 10);  
If (&ret = %MDA_success) Then 
  MessageBox(0, "MetaData Fn Status", 0, 0, "SetDBFieldFormatLength succeeded"); 
Else 
  MessageBox(0, "MetaData Fn Status", 0, 0, "SetDBFieldFormatLength 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.