Hi, I’m trying to send an email and attach it to a...
# suitescript
b
Hi, I’m trying to send an email and attach it to a custom record as a related record. However, I am not able to successfully do it. By any chance can someone help with the correct syntax this is what I tried doing but I am getting an unexpected error:
Copy code
email.send({
                    author: paramEmailAuthor,
                    body: objEmailBody,
                    recipients: [stEmailRecipient],
                    subject: objEmailSubject,
                    attachments: [objFileAttachment],
                    bcc: null,
                    cc: null,
                    relatedRecords: {
                        entityId: intCustomerId,
                        transactionId: intTransactionId,
                        customRecord: {
                            id: 4301, //internal id of the custom record
                            recordType: 829 //internal id of the custom record type
                        }
                    }
                });
s
I would try a combination of making
4301
and
829
strings, as well as trying the
customrecord_mycustomrecord
id instead of
829
b
syntax looks fine
you should make sure all your variables have valid values