Record.setText(options)
Method Description |
Sets the value of the field by a text representation. (dynamic and standard mode — see SuiteScript 2.x Standard and Dynamic Modes) Sets a string value with a "%" for rate and ratehighprecision fields. |
Returns |
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
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 |
|
string | array |
required |
The text or texts to change the field value to.
|
2015.2 |
|
boolean |
optional |
If set to By default, this value is |
2015.2 |
Errors
Error Code |
Thrown If |
---|---|
|
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.
// Add additional code
...
objRecord.setText({
fieldId: 'item',
text: 'value',
ignoreFieldChange: true
});
...
// Add additional code
The following code sample shows the syntax for INLINEHTML fields and what is returned.
...
objRecord.setText(inlineHtmlFieldId, '<i>foo</i>'); // Returns nonformatted text with the exact
// form given, i.e. '<i>foo</i>'
objRecord.getValue(inlineHtmlFieldId); // Returns '<i>foo</i>'
objRecord.getText(inlineHtmlFieldId); // Returns '<i>foo</i>'
...