How to hide attachment from service portal

Joyal Robert
Tera Contributor

How can we hide attachment inside the service portal. What script need to be added to server side of widget editor to hide attachment?

Please help

18 REPLIES 18

I tried the script you have given before, it doesn't make any changes in attachment file when i open in the portal i am still seeing the attachment file over there

https://www.youtube.com/watch?v=xeh8-OA8UMc 

Please go through the video. This will solve it.

 

I didn't need to remove add attachment i need to remove the file which i upload in add attachment after submitting the form

There is an Script Include named AttachmentAjax that can be called from a Client Script using GlideAjax to perform several attachment related tasks like: list, delete, rename, etc.

 

GlideSysAttachment can be used to delete attachment as follows:

var attachment = new GlideSysAttachment();

var agr = attachment.getAllAttachments(<table_name>, <table sys id>);

while(agr.next()) {

        attachment.deleteAttachment(agr.getValue("sys_id"));

}

These script will disable all attachment right. We need only specific attachment to be removed