Inserts a new row with specific field values in a reference table.
Parameters
Parameter | Type | Description |
---|---|---|
new-row (required) | map | A field or fields with the new values for the specified row, represented as a map object where the column names are the keys and the field values are the values. |
Remarks
The names and type of the fields that you are inserting must match the declaration file of the reference table. The method throws a Unique contsraint violation error at runtime if the table already has a row with the value that you specified in the new-row parameter in its primary key field.
The new-row parameter does not need to have a value for each of the fields in the row. Fields
with unsupplied values will have null
assigned
as their value. The method will throw a runtime error if null
is
assigned to a field which is marked NotNull="true"
in its declaration file,
so best practice is to always supply an explicit value for NotNull="true"
reference table columns when inserting one or more rows into them.
Sample
Download the declaration file for the sample reference table here.
Figure 416. The reference table used in the sample below
"We have a new cat", [ {name: "Fjord", age: 3, color: "ginger", weight: 2, sex: "female"}, {name: "Coco", age: 1, color: "black", weight: 2, sex: "male"} ]
Figure 417. The trace message output of the script above