Skip to content

Auto-sending an email with a PDF report attached (via Command_SYS.Mail and Pdf_Archive_API.Get_Id) works, but the attached PDF's filename comes through as a generic/default name — how do you set a custom filename for the attachment?

Answer

Append the desired filename (including its .pdf extension) as an additional segment inside the same '###'-delimited attach_ string, after the existing archive ID, print job ID, and result key segments — for example: attach_ := '###'||Pdf_Archive_API.Get_Id(result_key_,print_job_id_)||'###'||to_char(print_job_id_)||'###'||to_char(result_key_)||'###'||your_desired_filename_||'.pdf'||'###'. The '###' delimiters are required around each segment (removing them breaks the mechanism entirely), and adding your filename as its own segment within that same structure is what actually controls the attachment's filename.

← Browse Developer Studio, deployment, and upgrades questions