- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2025 11:05 PM
Hi,
I want to hide the 'Retire' button displayed on the form for members belonging to a group that has the 'knowledge' role. The 'Retire' button is OOTB so I don't want to modify it too much considering future upgrades.
How should I achieve this?
Regards,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2025 11:39 PM
share the onload client script script and config screenshot
Ensure Isolate Script = False for your client script so that DOM manipulation works
I agree with what @Mark Manders said, you can update the OOTB ui action as well and review the changes after upgrade.
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
‎05-07-2025 11:30 PM
There are multiple 'retire' UI actions on the kb_knowledge table, so you need to first be sure which one you need to inactivate (using SNUtils can help).
And you are either updating it or not. There is no 'too much', because the moment you change it, it becomes a skipped change whenever ServiceNow touches it in a future patch/release. So you either change it or you don't and that means that you need to weigh your requirement vs the benefit.
The change itself will be an extra condition to exclude that group from seeing the button. Since the condition on all three OOB ui actions includes the KBKnowledge().canRetire(current) reference, best thing to do is to check on that function in the script include and exclude the group there.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2025 11:43 PM
Thank you,
Because it affects our operations, immediate action is necessary.
Can I get help with the code to exclude that group from the Script Include?
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2025 12:50 AM
just add this to the canRetire function:
if(gs.isMemberOf('your group'))
return false;
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark