raghav
09/02/2026, 9:22 AMCeligo AI
09/02/2026, 9:22 AMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** To attach an email to multiple transactions in SuiteScript, you would need to send one email per transaction and set that transaction as the related record transaction ID. However, this cannot be done in a single call. Here is a sample code snippet:
javascript
email.send({
author: 23130,
recipients: sendTo,
subject: subject,
body: body,
attachments: [billPayFile],
relatedRecords: {
entityId: vendorId,
transactionId: billPayId
}
});
In the above code, billPayId is the internal id of the transaction. Please note that the relatedRecords property starts with a lowercase 'r', not an uppercase 'R'.
However, there is no direct way to link transaction attachments to emails. You would need to download them from the transaction's Files tab and attach them again manually. Alternatively, you can use a workflow or script to automatically copy important attachments to a standard File Cabinet folder. This makes them easier to find while composing an email.
Please note that some mail servers may remove attachments of certain types (zip, pdf, etc.) based on security rules. If you are facing issues with the email not being attached to the transaction, it could be due to a typo in the property name or an unexpected SuiteScript error. If neither RelatedRecords nor relatedRecords is working, you may need to further investigate the issue.Celigo AI
09/02/2026, 9:22 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.874450743
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835022032
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834716797
Celigo AI
09/02/2026, 9:22 AMraghav
09/02/2026, 9:23 AM