Modules
Objects/Functions
SuiteScript 2.0
{file}.delete({id: {number | string*}})
N/file Module
file.delete()
Method Description:
Method used to delete an existing file from the NetSuite File Cabinet.
Returns:
The internal ID of the deleted file
Supported Script Types:
Server-side scripts
For more information, see SuiteScript 2.0 Script Types.
Governance:
20 units
Module:
N/file Module
Since:
2015.2
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=file.delete(options)
Example:
// Code Example 1
//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
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4226573892.html