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

Did you clone any widget under scoped application?

I cloned the Data Table from Instance Definition widget, and that is what I'm currently using.

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

I could but will it be saved in my scoped updated set? 

No