Ext.CreateAppRecord()

Creates a new AppRecord object of a subtype appropriate for the database table specified by tableId.

Function Signature

 AppRecord Ext.CreateAppRecord( tableId [, fieldType] )

Parameters

Parameter Type Description

tableId

int

A value from TS_TABLES. See Ext.TableId().

fieldType

int

Optional. When creating field objects, specifies the data type to be stored in the field. See FieldTypeConstants.

Return

Type Description

AppRecord

The newly-created AppRecord object.

Technical Details

SBM ModScript version: 11.3.

Notes

When a primary table is specified, the new object is a ProjectBasedRecord. When an auxiliary table is specified, a VarRecord is created. For other tables, an AppRecord subtype is created if one exists in SBM ModScript (for example, a Change object for the TS_CHANGES table). Otherwise, a generic AppRecord object is created.

When the table that is specified is not primary or auxiliary, the AppRecord that is created will have a schema related to that table. This means AppRecord.GetFieldValue() will work if the specfied field is from that table's schema. Use AppRecord.GetSchemaColumns() to list the columns in the schema for the AppRecord.

Related Topics

Extension Functions