How to clear File Attachment type field in client script?

Pranshu3
Tera Expert

Hi all,

I have a 'File Attachment' type field on Demand table. Now, on the form, this field is dependent on another field.

If the choice option for 'Need attachment?' field is selected as 'Yes', the 'File Attachment' field is visible and a file can be attached to the field, but onChange of 'Need attachment?' field choice to 'No', 'File Attachment' field should disappear as well as the attachment should be removed.

How to remove the attachment on 'File Attachment' field in onChange client script of 'Need attachment?' field ??

Thanks all!

1 ACCEPTED SOLUTION

Hi Ankur,

Along with not displaying the 'File Attachment' field, I am willing to remove the attached file as well, so that on re-display on the field, it comes blank.

The solution found : GlideAjax from Client Script, in script include, GlideRecord sys_attachment table and removed the latest file related to that table record. Though this is not a completely accurate procedure, but a feasible workaround.

Hope others can put in better solution!

View solution in original post

5 REPLIES 5

Aya Bauyrzhanky
Tera Contributor

Hi,

Flow Designer can delete File Attachment fields