How to hide attachment icon in portal when the ticket is in closed state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2021 12:58 AM
Hi,
I have one requirement in which I need to hide the attachment icon from portal when the ticket is in closed complete/ closed cancelled/ Review state.
I tried client script but that is working in native UI not in portal.
Please help to complete this requirement
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2021 01:58 AM
Hi,
You can refer this post:
https://community.servicenow.com/community?id=community_article&sys_id=aff2e9ccdbc17300d82ffb24399619fa
In client script make sure to select UI Type as "Mobile/Service Portal".
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2021 02:14 AM
Thanks Asha for response.
I have tried this as well .This code is working in back end view but non in service portal.
Any help is appreciated.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2021 02:21 AM
I have tried below code for OOTB service portal page with id=form, incident record, and it is working for me.
var attachmentButton = top.document.getElementsByTagName('sp-attachment-button');
attachmentButton[0].parentNode.hidden = true;
You can add additional conditions as per your requirement.
Send screenshot of both client script and portal page, so that it will be easy to understand. Also, check for browser logs if anything breaking in your client script.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2021 02:29 AM