AddField method: RecordDefn class
Syntax
AddField(existing_fieldname)
Description
Use this method to create a new record field definition for a given field populated with default record field definition values. The new record field is appended to the list of record fields.
Parameters
| Parameter | Description |
|---|---|
|
existing_fieldname |
Specifies an existing field in the record definition. |
Returns
If the field is already on the record, the record field definition for that record field is returned.
Returns a null value if the field definition does not exist in the database.
Example
Local RecordDefn &myNewRecord = CreateRecordDefn();
&myNewRecord.Name = "MYRECORD_VW";
&myNewRecord.Description = "My new record";
&myNewRecord.SQL = "SELECT DISTINCT(PROCESS_INSTANCE) FROM PS_MESSAGE_LOG WHERE MESSAGE_NBR = 1018";
Local RecordFieldDefn &recField = &myNewRecord.AddField("MYFIELD");
If All(&recField) Then
&recField.Key = True;
End-If;