file.delete(options)
Method Description |
Method used to delete an existing file from the NetSuite File Cabinet. |
Returns |
void |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
20 units |
Module |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
number | string |
required |
|
2015.2 |
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
<name of missing parameter> |
A required argument is not passed. |
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.create({
name: 'test.txt',
fileType: file.Type.PLAINTEXT,
contents: 'Hello World\nHello World'
});
fileObj.folder = 30;
var fileId = fileObj.save();
file.delete({
id: fileId
});
...
//Add additional code