Include additional attachments in IFS e-mail report is one of the top posts in my blog and received many good comments. One of the questions was that the methods used here are not compatible in IFS Cloud.
Script used in above post was developed for Apps8. By that time, Command_SYS.mail has limited capability of handling attachments. It could handle only files stored in extended server and add them as file path, and add the report pdf file.
Form IFS Application 10 onwards, Command_SYS mail functionality has several improvements. One major improvement is the way it handle attachments in emails. Now, it is possible to add attachments as an array of CLOBs or BLOBs or a file path (applied only for on-prem IFS cloud installations).
Below are the overrides of COMMAND_SYS.Add_Attachment for attaching documents stored in different data formats
PROCEDURE Add_Attachment (attachments_ IN OUT NOCOPY attachment_arr, filename_ IN VARCHAR2, attachment_ IN CLOB );
PROCEDURE Add_Attachment (attachments_ IN OUT NOCOPY attachment_arr, filename_ IN VARCHAR2, attachment_ IN BLOB );
PROCEDURE Add_Attachment (attachments_ IN OUT NOCOPY attachment_arr, filepath_ IN VARCHAR2, i_ IN NUMBER );
In this post, we will look into two common scenarios of including additional attachments in IFS emails.
Create a CSV and attach as a file in IFS email
Suppose it’s needed to create a CSV file with order details and attach with the Purchase Order email once it’s printed. We can create the CSV inside our event script and attach as a CLOB in the email. Below script shows the approach in detail.
Here’s the resultant email and the content of the CSV looks like

Send Email including Documents and media attached to the record
In this example, we are attaching the documents and media attached to the Work Order when printing the Work Order report.

I hope this would give a better idea on dealing with attachments in IFS report emails. You can mix and match the scripts and create emails with the information you need. Please share your thoughts or if you find any cool tricks with handling attachments below 😎
Hi Damith,
It is very helpful. Thank you.
Thanks Hasan😎