- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 01:55 AM - edited 01-22-2025 04:09 AM
Hi,
I want to hide "Remove" button from attachment UI page. This is for Change Requests where state is Authorize.
How to achieve this?
This requirement is to confirm that no one can delete the attachment once change request is approved.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 01:58 AM
Check this link Solved: User should not able to delete attachment in chang... - ServiceNow Community
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 01:58 AM
Check this link Solved: User should not able to delete attachment in chang... - ServiceNow Community
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 02:10 AM
can try following script on client side.
function onLoad() {
// Check if the current Change Request state is 'Authorize'
var state = g_form.getValue('state');
if (state == 'Authorized') {
// Hide the 'Remove' button in the attachment section
var removeButton = document.querySelector('.attachment-delete'); // Use the correct class selector for the button
if (removeButton) {
removeButton.style.display = 'none'; // Hide the Remove button
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 02:25 AM
why to remove?
It's an OOB ui page which gives capability to users to remove file if they wish to
2 ways to handle
1) you can have before delete BR on sys_attachment which checks that the CHG is in which state and based on that abort the deletion
OR
2) create a new delete ACL on sys_attachment or update an existing one and GlideRecord and see if user is authorized to delete
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 07:47 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader