Shmuel H
09/12/2024, 4:19 PMCeligo AI
09/12/2024, 4:20 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems like you're trying to change the parent folder of a root directory in the file cabinet. However, you're encountering an error that says "FOLDER_DOES_NOT_EXIST_OR_YOU_DON_T_HAVE_ACCESS_TO_THE_FOLDER". This error typically occurs when the folder you're trying to access doesn't exist or you don't have the necessary permissions to access it. Since you're running the script as an administrator, it's likely that the folder doesn't exist. In your code, you're trying to load a folder with the ID 16578399 and then change its parent to a folder with the ID 4074930. Please ensure that both these folders exist in your file cabinet. If you're trying to change the parent of a root directory, it's important to note that root directories in the file cabinet don't have a parent folder. They are the top-level folders in the file cabinet hierarchy. Therefore, trying to change their parent folder might not be possible. Here's a sample code snippet that shows how to create a folder in a specific directory:
javascript
function createFolderPerCustomer(_customerName_) {
const objRecord = _record_.create({
type: _record_.Type.FOLDER,
isDynamic: true
});
objRecord.setValue({
fieldId: 'name',
value: _customerName_
});
objRecord.setValue({
fieldId: 'parent',
value: _parentFolderId_ // replace with your parent folder's internal ID
});
const folderId = objRecord.save({
enableSourcing: true,
ignoreMandatoryFields: true
});
return folderId;
}
In this code, we're creating a new folder with the specified customer name and saving it in a specific parent directory. The parent directory is specified by its internal ID.
******
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
09/12/2024, 4:20 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.847576916
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.825306118
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814479053
Celigo AI
09/12/2024, 4:20 PMCeligo AI
09/12/2024, 6:28 PM