Your script has a number of details that look to be a source of trouble. You have a go to related records step where the specified layout is <unknown>
You have two extra End If steps--would think you'd get an error just trying to close the script editor.
Go to Object[object name: "Press"]
doesn't seem to be needed in your script unless it is tripping a script trigger by doing so.
Once you have created and saved the PDF useing $Path as the designated variable for file name and location, you can add a Send mail step after the save as pdf step, click the attach file checkbox and type in the variable name. The mail sent by that script step will then attach the PDF to the email.
Thank you PhilModJunk for your words of wisdom - the major script errors have been corrected and the functions work well now...
....with the exception of inserting the client's email address into the 'To' field in the email.
Should this be a calculation rather than a specify field? I have a field for the client's email address but not sure how to set this as a calculation.
Hi there - Can you tell me if there a limit to what you are able to insert as a subject line in the calculation?
The calculation formula I entered for the pdf file to be saved was "Client Confirmation ref :" & FIELD FOR CLIENT NAME & "_" & FIELD FOR CAMPAIGN TITLE & "_" FIELD FOR CONFIRMATION REF
This appeared to work but when I enter a similar formula for the subject line in the email, it always misses out the client name.
The two options for TO should produce the same results.
I think the issue is involved with where this information ( and the client name ) are stored. I'm guessing that they are not stored in the "main confo" table, but a different table. If so, you need either a valid relationship between the two tables at the time Send Mail is executed or you'll need to modify your approach in order to access the needed data.
Where is this data stored and what relationship, if any do you have between that table and "Main Confo"?