Updates a specific row in the reference table to specific field values.
Parameters
Parameter | Type | Description |
---|---|---|
search-field (required) | map | A field that identifies a row in the reftable object, represented as a map object where the column name is the key and the field value is the value. |
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 method throws a Could not find row to update... error at runtime if there is no row that matches the search-field parameter in the reftable object.
The new-row parameter does not need to have a value for each of the fields in the row. Fields with unsupplied new values will not change.
The method throws a More than one row found to update... error at runtime if there are more than one rows that match the search-field parameter in the reftable.
Sample
Download the declaration file for the sample reference table here.
Figure 412. The reference table used in the sample below
"Note that Fjord's sex was not updated", [ {name: "Fjord", age: 5, color: "spotted", weight: 8, sex: "male"}, ... ]
Figure 413. The trace message output of the script above