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

Press Ctrl+ Right Click on the form 

How can i create a copy of this form instance? I don't want to change the origina. Also, if i use a copy, should i re-configure my Data Table widget?

find_real_file.png

Hi, 

You can create a new page and clone OOB Form widget. Then link Data Table Instance widget to the new page.

1. Navigate to Service Portal-> Widgets. Search for Form widget and clone it.

Go to the CSS of cloned Form widget and add display:none; for below class and save it

find_real_file.png

2. Navigate to Service Portal ->Pages. Create a new page and add Cloned Form widget

3. Now Ctrl+Right click on Data Table Instance widget and click Instance Options and select your new page in Link to this page and save it

find_real_file.png

find_real_file.png

I'm not using a page for my form view. It's just automatically redirects me in that form whenever I click the record in the list view of my data table. 

I got this error: GlideTableDescriptor is not allowed in scoped applications

find_real_file.png