Result.getValue(options)
Method Description |
Gets the value at a given index in Result.values. Value types correspond to the ResultSet.types property. Values correspond to the values for ResultSet.columns. |
Returns |
<string | number | Date | null> (read-only) |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Parent Object |
|
Sibling Object Members |
|
Since |
2018.2 |
Parameters
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
number |
required |
The index of the element from Result.values that you want the method to return. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/query Module Script Samples.
// Add additional code
...
const COLUMNS = ['entityid', 'id'];
const employeeInfo = {};
let employeeQuery = query.create({
type: query.Type.EMPLOYEE
});
COLUMNS.forEach(column => {
employeeQuery.columns.push(employeeQuery.createColumn({
fieldId: column
}));
});
const resultSet = employeeQuery.run();
const results = resultSet.results || [];
results.forEach(result => {
for (let i = 0; i < result.values.length; i++) {
employeeInfo[COLUMNS[i]] = result.getValue(i);
}
});
...
// Add additional code