- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 06:18 PM
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.
I have already created a UI policy for this, but it seems like it only applies to the instance/back-end.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 12:56 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2022 08:50 PM
Did you clone any widget under scoped application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 12:12 AM
I cloned the Data Table from Instance Definition widget, and that is what I'm currently using.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 12:56 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 01:01 AM
I could but will it be saved in my scoped updated set?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 01:04 AM
No