Irina Mitrova
02/17/2025, 1:56 PMCeligo AI
02/17/2025, 1:56 PMAI generated answer (using internal Slack threads):To get the integer value of the invoice recordType when using relatedRecords in the email.send function in a Suitlet, you need to use the recordType property in the relatedRecords object. This property should be set to the internal ID of the record type, which in the case of an invoice, is the internal ID of the invoice record. Here is a sample code snippet:
javascript
var senderId = -5;
var recipientEmail = '<mailto:notify@myCompany.com|notify@myCompany.com>';
var recipientId = 12;
var invoiceId = 123; // replace with your invoice id
var fileObj = file.load({
id: 88
});
email.send({
author: senderId,
recipients: recipientId,
subject: 'Test Sample Email Module',
body: 'email body',
attachments: [fileObj],
relatedRecords: {
entityId: recipientId,
transactionId: invoiceId
}
});
In this example, the transactionId
property in the relatedRecords
object is set to the internal ID of the invoice record. This will attach the email to the invoice record.
******
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/17/2025, 1:56 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.805466592
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.803932548
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.803635299
Celigo AI
02/17/2025, 1:56 PM