File.appendLine(options)
Method Description |
Method used to insert a line to the end of a file. This method can be used on text or .csv files.
Important:
Content held in memory is limited to 10MB. Therefore, each line must be less than 10MB. |
Returns |
file.File Object |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2017.1 |
Parameters
The options parameter is a JavaScript object. The table below describes the name:value pairs that make up the object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
Object containing a string to insert at the end of the file. |
2017.1 |
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
The content you are attempting to access exceeds the maximum allowed size of 10 MB. |
You attempt to return the content of a line larger than 10MB. |
|
— |
You call File.appendLine(options) after calling File.lines.iterator(). To avoid receiving the error, call File.resetStream() or save the file. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/file Module Script Samples.
//Add additional code
...
var fileObj = file.load({
id: 145
});
fileObj.appendLine({
value: 'hello world'
});
...
//Add additional code