Add attachments to the email function from the existing incident record.

Khalnayak
Tera Guru

Hi,

I have a requirement to allow users to add attachments from the existing incident record when using the email function.

I have come across articles, which leverage before BR and attaches all the attachments to the email.

I do not want that, In the email when i click on the attachment icon, I should see all the attachments from the incident there.

Also I have seen BR scripts which duplicate the attachment when sent.

Please help.

1 ACCEPTED SOLUTION

can you try with below code. 

 

After "Insert" business rule on "sys_email" table .

 

script:

 

(function executeRule(current, previous /*null when async*/) {

	// Add your code here

	GlideSysAttachment.copy(current.target_table,  current.instance ,'sys_email', current.sys_id);


})(current, previous);

 

See if its not creating duplicate attachment on email client. 

View solution in original post

20 REPLIES 20

May i know the use case ? 

based on your script you are just copying the attachment from record to email client, do you have any specific condition on your use case where you dont want auto attach ? please elaborate your requirement. 

 

Based on existing response, Another approach i would have here to upload the attachment on your email client body as a hyper link.  

Thanks Harsh,

The use case would be to allow user to attach attachments to the email which are attached to the record, without uploading them.

So we do not want the attachments to be attached itself, only when the atachment icon is clicked then the attachments should be displayed there to choose from.

We do not want hyperlinks, actual attachment is good.

I doubt you would be able to control this on specific email client paper clip icon. 

Here manual approach would require, which ever attachment you don't need just remove from attachment icon before clicking the "Send" button 

Let me know if you have any further question here.

 

If i answered your query , kindly mark it as correct and close this thread. 

Hi Usmaan,

 

Seems you already were able to solve the issue of duplicate attachment but the functionality you looking for I doubt is feasible. Even if so, will have to be complete custom solution which seems complicated as well.

Since, you have avoided the duplication of attachments you can click on paper-clip icon & remove the attachments before sending manually. Anyways, for the approach that you look i.e. to add attachments I guess better is to remove attachment then adding from client template.