Milcho Dimkov
04/21/2025, 6:02 PMCeligo AI
04/21/2025, 6:02 PMAI generated answer (using internal Slack threads):To create a new folder via SuiteScript, you can use the
N/record
module to create a record of type FOLDER
. Here is a sample code snippet:
javascript
var record = require('N/record');
function createFolder(folderName, parentFolderId) {
var folderRecord = record.create({
type: record.Type.FOLDER,
isDynamic: true
});
folderRecord.setValue({
fieldId: 'name',
value: folderName
});
folderRecord.setValue({
fieldId: 'parent',
value: parentFolderId
});
var folderId = folderRecord.save({
enableSourcing: true,
ignoreMandatoryFields: true
});
return folderId;
}
In this function, folderName
is the name of the new folder you want to create, and parentFolderId
is the internal ID of the parent folder where you want to create the new folder. If you want to create a root folder, you can omit the parent
field.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
04/21/2025, 6:02 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.876672149
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852106571
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84120518
Celigo AI
04/21/2025, 6:02 PM