The CreatorCon Call for Content is officially open! Get started here.

Disable editing of attachment in Service Portal

Gab
Tera Expert

I would like to disable the attachment in a form view of a record in Service Portal.

I'm using Data Table from Instance Definition widget.

find_real_file.png

find_real_file.png

 

I have already created a UI policy for this, but it seems like it only applies to the instance/back-end.

find_real_file.png

1 ACCEPTED SOLUTION

Can you clone the widget in global scope and check if the issue still persists?

 

Also,

There is another way to hide attachments from Service Portal using DOM manipulation but it is not best practice to use DOM manipulation. You can try below code in OnLoad Client script

Table - sc_request
UI Type - Mobile/Service Portal
Type - onLoad
Isolate Script - Set it to false/Uncheck

function onLoad() {
var attachmentButton = top.document.getElementsByTagName('sp-attachment-button');
attachmentButton[0].parentNode.hidden = true;
top.document.getElementsByClassName('sp-attachment-manager')[0].style.display = 'none';
}

 

If you are doing it through client script, you don't need to clone any widget

View solution in original post

15 REPLIES 15

Shruti
Mega Sage
Mega Sage

Hi,

You can do that via the CSS. Try to add below code to the widget instance CSS 

.attachment-button {
display:none;
}

.sp-attachment-manager {
display: none;
}

It's not working.

Hi,

Please click on a request record on Data table instance widget. Go to  the Instance in Page Editor for the Form and Paste the Code in CSS and save the form

find_real_file.png

 

find_real_file.png

find_real_file.png

I could not find the Instance in Page Editor option

find_real_file.png