Disable renaming attachment

Tadz
Tera Guru
Tera Guru

Hi, is it possible to disable the renaming of the attachment?

Because i have disabled the attachment when the request is closed. using g_form.disableAttachments();

The g_form.disableAttachments(); works but I can still rename the attachment.

Is there any way to disable that?

Here is a sample screenshot:

attachment_renaming.PNG

Thanks,

Tadz

10 REPLIES 10

Hi Kalai,



Is this a DOM manipulation?


Client Script?



Thanks,


Tadz


Yes DOM manipulation. Add it in a client script and check.


Thank you for your response Kalai


But is there any other way than DOM manipulation?



Thanks,


Tadz


I told that already in my earlier response that I am not aware of a better way.


Nia McCash
Mega Sage
Mega Sage

I was able to do this by modifying the attachment_entry UI Macro that comes OOB with ServiceNow.  



WARNING: this does overwrite the default functionality which means future updates will not be applied to this UI Macro.  



I commented out lines 76-107 which specifies the [rename] link in the UI Macro.   The [rename] link disappears except for when new attachments are added.   I haven't figured this part out yet but when you add a new attachment, the [rename] link appears next to the newly attached file.