Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

How to remove attachments in email without removing the record from attachements table

GANESH23
Tera Contributor

Hi Team,

I want to remove attchment from email while sending,at it is in send-ready state without removing the record from sys attachments table.

Thanks,

28 REPLIES 28

Hi,

can you try this

var gr = new GlideRecord('sys_attachment');

gr.addQuery('table_sys_id', current.sys_id);

gr.query();

gr.deleteMultiple();

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

I Don't want to delete record from sys attachment table. this sys attachment table is reffering to my report store.

without deleting the record from sys attachment. is it possible?

 

Thanks,

Mohan.

Hi,

unless you delete sys_attachment record the file will be present as attachment on the email record

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi,

Any other Solution?

Thanks,

Hi Ganesh,

I don't think so.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader