When a user clicks "Merge and Send" on an Email me...
# ask-stanley-ai
a
When a user clicks "Merge and Send" on an Email message they created from an Invoice, the Invoice PDF attached to the email message gets a long series of digits suffixed to the filename. How can I change that so the filename only has the transaction type and transaction number in its name?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that the default naming convention for PDF files in NetSuite, which includes a long series of digits (the internal ID), cannot be changed directly from the UI. However, it can be modified using SuiteScript. Here's a sample code snippet that was shared in the conversations:
Copy code
javascript
var emailPDF = renderFileRec.renderAsPdf();
emailPDF.name = pdfName + '.pdf';
In this code,
renderFileRec
is the record you want to render as a PDF, and
pdfName
is the new name you want to give to the PDF file. This code changes the name of the PDF file to the value of
pdfName
before it is sent. Please note that this requires a good understanding of SuiteScript and how to work with files and records in NetSuite. If you're not familiar with SuiteScript, you might need to seek help from someone who is, or spend some time learning it yourself. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848693848
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841674805
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840759337
Please provide your feedback on this answer.
a
That's incorrect. The long series of digits at the end of the filename is not its Internal ID. It is the timestamp of when the file was created.