CreateFieldDefn function
Syntax
CreateFieldDefn()
Description
Use the CreateFieldDefn function to create a field definition with the same property defaults that Application Designer provides:
-
Type: Character
-
Field Length: 1
-
Field Format Type: Uppercase
This function sets the RuntimeDefn flag for the field.
All other properties are blank or not set.
Parameters
None.
Returns
A field definition object.
Returns a null value if the user doesn’t have write permissions for fields.
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;
Related Topics