attaching a file to be sent with an invoice progra...
# ask-stanley-ai
l
attaching a file to be sent with an invoice programatically
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that you can attach a file to be sent with an invoice programmatically using SuiteScript. Here's a general approach: 1. Create a saved search that sources the internal ID of the file you want onto each Invoice record. This transaction saved search should display the internal ID of the files attached to each record. Filter it to ensure it is selecting the correct file for each record. Put a Summary of Max on the file.internalid field and a filter of InternalID on the saved search. 2. Create a custom body field (Free Text) where store value is False and the field source is the saved search you made (Under validating and defaulting). 3. Create another custom body field (Type Document) and have a scheduled Workflow run that will set the custom body document field using the internal ID you set in the Free Text field. 4. Use that custom body document field as the attachment in your Send Email action. 5. You may also be able to use the same scheduled Workflow with the send email action. Just put the sourcing of your document field first, then send email after it in the list of actions. So when your Workflow runs, it first sets the Document field, then sends the email using that document field as an attachment. Remember, when sourcing the document field, you need to use a formula and the formula is your text field. ****** 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.840320289
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.826498926
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821253955
Please provide your feedback on this answer.