AddSubRecord method: RecordDefn class

Syntax

AddSubRecord(existing_subrecordname, sequence_number)

Description

Use this method to add the given subrecord to a record definition. If the record definition already contains the subrecord, it returns the %MDA_Duplicate error status and does not create a duplicate subrecord.

Parameters

Parameter Description

existing_subrecordname

Specifies an existing subrecord.

sequence_number

Specify where to insert the subrecord within the list of fields and subrecords on the record definition.

Specify 0 to insert it at the beginning. If not specified, by default, the subrecord is appended to the list of fields and subrecords on the record definition at the end.

Returns

A Boolean value representing the following statuses.

Numeric Value Constant Value Description

0

%MDA_Success

The subrecord is added successfully.

5

%MDA_Duplicate

The given subrecord is already in the record.

12

%MDA_InvalidDefn

The subrecord does not exist in the database.

1

%MDA_Failed

The subrecord is not added due to an internal error.

Example

Local RecordDefn &myRecord = GetRecordDefn("MYRECORD_VW");
&retVal = &myRecord.AddSubRecord("ADDRESS_SBR");