NS User
08/29/2025, 9:24 PMCeligo AI
08/29/2025, 9:24 PMAI generated answer (using internal Slack threads):To upload multiple files to a document field on an invoice transaction record, you can use the
record.attach(options)
method in SuiteScript. This method allows you to attach a file to a record programmatically.
Here is a basic example of how you can use this method:
javascript
var myFile = file.load({
id: '1234' // replace with your file id
});
record.attach({
record: {
type: 'invoice',
id: '5678' // replace with your invoice id
},
file: myFile
});
In this example, file.load
is used to load the file that you want to attach, and record.attach
is used to attach the loaded file to the invoice. You would need to replace '1234' with the ID of the file you want to attach, and '5678' with the ID of the invoice to which you want to attach the file.
If you want to attach multiple files, you can put the above code in a loop and replace the file id with the ids of the files you want to attach.
Please note that this method attaches the file to the record as a whole, not to individual line items. If you want to attach files to individual line items, you might need to create a custom field of type 'Document' for the line items and then use scripting to attach the files to these fields.
******
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
08/29/2025, 9:24 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.846122444
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844106734
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843493462
Celigo AI
08/29/2025, 9:24 PM