GetFieldDefn function

Syntax

GetFieldDefn(field_name)

Description

Use the GetFieldDefn function to return an existing field definition.

Parameters

Parameter Description

field_name

Specify the field to be retrieved.

Returns

A field definition object.

Returns a null value if the field definition doesn’t exist, the field is not a supported type in PeopleCode, or the user does not have permissions to access the field.

Example

Local FieldDefn &mktField = GetFieldDefn("MARKET");
If All(&mktField) Then
   &mktField.Description = "My new Market field";
   &retVal = &mktField.SetLabel("MYMARKET", "My Market", "My New Market", True);
   /* do error checking … */
   Local date &myDate = Date3(1900, 1, 1);
   &retVal = &mktField.SetTranslateValue("A", True, &myDate, "My New Market", "My Market");
   /* do error checking … */
   &retVal = &mktField.SaveAs("MYMARKET");
   /* do error checking … */
End-If;