Had to use a custom workflow action script for tha...
# suiteflow
r
Had to use a custom workflow action script for that requirement. The standard email action has no access to the record attachments
a
@mattb If it's just 1 file you could source that into a custom field on the invoice. Then that custom field can be used to include attachments in the send email action. But if it's multiple file then it won't work without a custom WFA
m
@AI1 woah, that’s an interesting though! yes it’s only ever one file. what if I want to send the transaction as an attachment (i.e. the transaction PDF) and the additional file, though? I think the workflow send email action only allows for the transaction or a custom field (as a file)?
a
I think I've done both in the past. Let me check in the morning. I have a PO workflow that's sending the PO with attachment so I'm pretty sure it can do both
m
i should also mention the attached pdf i am attempting to attach is unique per each transaction (invoice)
a
Yes I am sending the invoice as a pdf AND a pdf attached file
Also you would just need to create a saved search that sources the internal ID of the file you want onto each Invoice record. So a transaction saved search that displays the internal ID of the files attached to each record. Then filter it to make sure it is selecting the correct file for each record. (In case there are multiples or weird files you dont want). And put a SUmmary of Max on the file.internalid field. Then put a filter of InternalID on the saved search. Then create a custom body field (Free Text) where store value is False and the saved search you made is the field source (Under validating and defaulting). Then make another custom body field (Type Document) and have a shceduled WF run that will set the custom body document field using the internal ID you set in the Free Text field. Then you can use that custom body document field as the attachment in your Send Email aciton.
Or you may even be able to use the same scheduled WF 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 WF runs it first sets the Document field, then sends the email using that document field as an attachment.
m
@AI1 awesome thank you. my only drama so far is that in the workflow when setting the field value, the “current record” is showing the same field i’m attempting to set the value for
a
You should have 2 fields. 1 is a document field and 1 is a text field that holds the internal id of the file when sourcing the document field you need to use a formula and the formula is your text field
m
@AI1 nailed it! thank you! what a great use of a couple of fields and workflow
a
Awesome!! Glad it worked