Compose email should attach the attachments of the corresponding record automatically.

Ramkumar Thanga
Mega Sage

Hi Everyone,

 

I am trying with a requirement to add all the corresponding attachments of the record to the email draft while composing an email from Work space.

 

The following business rule script which runs with the following condition works in native UI but not in workspace.

Any idea to make this workable in workspace.

 

Table: sys_email 

>> Conditions:

Before 

Insert 

Filter condition:

Target table | is | sc_task 

Script :

 

 

 

var gr = new GlideRecord('sys_attachment');
   gr.addQuery('table_sys_id', current.target_record);
   gr.query();
    if (gr.next()) {
        
        GlideSysAttachment.copy('sc_task', gr.table_sys_id, 'sys_email', current.sys_id);
       

    }

 

 

 

Thanks !
Ramkumar

 

5 REPLIES 5

I tried with this table sys_email_draft, but no luck.

 

Thanks!

 

Ramkumar