Benjamin Cookson
02/14/2025, 10:17 PMCeligo AI
02/14/2025, 10:17 PMAI generated answer (using internal Slack threads):To set a default folder on an image field on a custom record, you can't directly set the default folder in the UI. However, you can programmatically set the default folder when saving the file. Here's a general idea of how you can do it: 1. Create a SuiteScript that triggers on the afterSubmit event of the record. 2. In the script, get the file from the field. 3. Set the folder on the file using the
folder
property.
4. Save the file.
Here's a sample code snippet:
javascript
function afterSubmit(context) {
var record = context.newRecord;
var fileObj = record.getValue({fieldId: 'custrecord_my_file_field'});
if (fileObj) {
fileObj.folder = '123'; // replace with your folder internal id
fileObj.save();
}
}
Please replace 'custrecord_my_file_field'
with your actual field id and '123'
with your actual folder 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
02/14/2025, 10:17 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.861785531
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.8283
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.813490391
Celigo AI
02/14/2025, 10:17 PM