Record.getText(options)
Method Description |
Returns the text representation of a field value. (dynamic and standard mode — see SuiteScript 2.x Standard and Dynamic Modes) Gets a string value with a "%" for rate and ratehighprecision fields. |
Returns |
string
Note:
For multiselect fields, returns an array. |
Supported Script Types |
Client and server scripts. For more information, see SuiteScript 2.x Script Types. In dynamic mode, you can use getText() without limitation but, in standard mode, limitations exist. In standard mode, you can use this method only in the following cases:
For more details, refer to the description of the SSS_INVALID_API_USAGE error code in the Errors table. |
Governance |
None |
Module |
|
Sibling Object Members |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
The internal ID of a standard or custom body field. |
2015.2 |
Errors
Error Code |
Thrown If |
---|---|
|
Invoked in certain cases when standard mode is being used. For example, if Record.isDynamic is set to false, the SSS_INVALID_API_USAGE error can be invoked in the following situations:
Similar guidance affects user event scripts that instantiate records by using the newRecord or oldRecord object provided by the script context. In these cases, standard mode is always used. For that reason, the SSS_INVALID_API_USAGE error appears when a user event executes on one of these objects in the following situations:
|
|
A required argument is missing or undefined. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/record Module Script Samples.
// Synax Sample 1
// Add additional code
...
var fieldidname = objRecord.getText({
fieldId: 'item'
});
...
// Add additional code
// Syntax Sample 2
// Add additional code
...
myString = 'Date is: ' + record.getText({fieldId: 'datechanged'});
// "Date is: 3/27/2017 9:55:38am"
...
// Add additional code