Service Catalog - Removal of Attachment icon on the portal after submitting the catalog item

Tek1
Kilo Contributor

Hello,

I've a requirement to remove the Attachment paper clip for the catalog items after submitting the item i.e, on the submit page of the Portal, for which we've opted 'Hide Attachment' as 'True' in the Portal Settings. I've tried multiple ways by modifying the 'Ticket Attachments' widget on the Service Portal. But nothing worked out.

 find_real_file.png

Please help me with the procedure.

Thanks in advance

1 ACCEPTED SOLUTION

Ok then modify to check the catalog item here, 

1. create a property with the sysid of the catalog items.

2. check if the ritm is from the catalog item.

3. block/allow the attachment

 

this should be added above the data.canAttach line. 

var currentRecord = $sp.getRecord(); // get the current record
var catitemrecord = currentRecord.cat_item; // check the catalog item


// the property should contain the sysid of the catalog item
var restricAttachment = (catitemrecord.indexOf(gs.getProperty('name of prop')) > -1)

// add the line "&& !restricAttachment" this will not allow attachment for the sysid mentioned in the property

data.canAttach = gs.hasRole(gs.getProperty("glide.attachment.role")) && GlideTableDescriptor.get(data.table).getED().getAttribute("no_attachment") != "true" && !restricAttachment;

View solution in original post

10 REPLIES 10

suvro
Mega Sage
Mega Sage

Press Cntrl and Right click on the widget --> Select Widget in Editor option ---> remove that section from the HTML where attachment is being used

Tek1
Kilo Contributor

Hi Suvro,

 

Thanks for your answer, but, the attachment functionality has to be removed only for two catalog items only for the remaining catalog items and incidents it should work as is.

 

Thanks

Sebastian L
Mega Sage

Hi,

Is it only for catalog items - so for incidents, the attachment should still be shown? Or do you wish to remove it from all tickets? 


Best regards,
Sebastian Laursen

Tek1
Kilo Contributor

Hello Sebastian,

Thanks for your answer, but, the attachment functionality has to be removed only for two catalog items only for the remaining catalog items and incidents it should work as is.

Thanks