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 02:33 AM
Hi Asha,
Could you please send the screenshot of your client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2021 03:18 AM
Hi,
This is different page, I was referring different page. Best way can be you can apply ACL to remove write access(as per your requirement) so that user will not be able to see attachment section and eventually will not be able to add any attachments.
Else you need to modify cloned Ticket attachment and Ticket Conversations widget according to your requirement.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2021 02:48 AM
do you want to hide for form page or ticket page
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2021 02:51 AM
Hi Ankur,
Want to hide in both the pages.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2021 03:08 AM
you can try to use ACL on incident table for example
So modify/create new Delete and Write ACL on that table with condition for your table and check state there
If that doesn't work then check below
for form page you can do this
1) onLoad client script on whatever table
a) check the state and use this code to remove that icon
function onLoad(){
var checkValue = g_form.getDisplayBox('state').value;
if (checkValue == "Closed"){
var attachmentButton = top.document.getElementsByTagName('sp-attachment-button');
attachmentButton[0].parentNode.hidden = true;
}
}
for ticket page you need to do this
1) clone the ticket attachments widget
2) in your newly cloned widget follow this steps
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader