Shelby Owens
12/23/2025, 8:08 PMCeligo AI
12/23/2025, 8:08 PMAI generated answer (using internal Slack threads):To attach a file to a support case from a Suitelet, you would need to create a Suitelet that includes a form with a file upload field. When the user submits the form, the file will be included in the request parameters. You can then save this file in the file cabinet and attach it to the support case. Here is a general outline of how you can achieve this: 1. Create a Suitelet that generates a form with a file upload field. You can use the
N/ui/serverWidget module to create the form and the file field.
2. In the Suitelet, handle the POST request. When the form is submitted, the file will be included in the request parameters. You can access this file using request.files.
3. Save the file in the file cabinet. You can use the N/file module to create a new file and save it. You would need to set the folder where the file will be saved.
4. Attach the file to the support case. You can use the N/record module to load the support case and attach the file to it.
Here is a code snippet that illustrates this process:
javascript
var fileObj = request.files.upload;
fileObj.folder = '-15'; // Set the internal ID of the folder where the file will be saved
var fileId = fileObj.save();
var caseRecord = record.load({
type: record.Type.SUPPORT_CASE,
id: '123' // Set the internal ID of the support case
});
caseRecord.attach({
record: {
type: 'file',
id: fileId
}
});
caseRecord.save();
Please note that this is a simplified example and you would need to adjust it according to your specific requirements. For example, you would need to handle the case where the user does not upload a file, and you would need to set the correct internal IDs for the folder and the support case.
******
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
12/23/2025, 8:09 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.85546881
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.845825195
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842590451
Celigo AI
12/23/2025, 8:09 PM