ConnectionResult
Last updated 2/10/2024
ConnectionResult Object
The
ConnectionResult
object is an object returned from executeConnection()
which contains
information about the results returned from the connection. ConnectionResult
is inherited from FiveError
, therefore you can
use isOk()
to know if the result was successful or not.
Functions
recordCount()
The
recordCount()
is a function used on the ConnectionResult
object that tells how many records have been returned.
Function Signature
recordCount() : number;
Example
The following code retrieves a list of records from a pre-figured connection and logs the returned record count to the Five Inspector.
Reading a list from a configured connection
let results = five.executeConnection('ODataRW', 'LIST');
if (results.isOk()) {
five.log('Record Count : ' + results.recordCount())
}
Properties
records
The
records
property available on the ConnectionResult
object contains the records that were returned from the data source.
Example
The following code retrieves a record using an OData configured connection.
Retrieving a record using an OData configured connection
results = five.executeConnection('ODataRW', 'READ', {key: 'jcitizen'});
if (results.isOk() && results.recordCount() === 1) {
five.log('Record Retrieved : ' + results.records[0].FirstName);
}