Any way to prevent right-click on table forms?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I would like to prevent users' right-click on table forms, but is there any way? I think it depends on web browser, though.
Best Regards,
Aki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you can't disable Right Click on Form/Record.
You can use UI script and DOM manipulation may be to hide some of the options when user right clicks but that's not recommended.
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Ankur Bawiskar ,
I created the following onLoad Client Script for Incident table with "Isolate script" = "false" and it successfully blocked the browser's right-click on the Incident form.
However, it didn't work when I created the script for custom table in the custom app. Does anyone know why it doesn't work?
function onLoad() {
document.addEventListener('contextmenu', event => event.preventDefault());
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you should allow DOM in your scope by creating this system property
example: sn_customerservice.glide.script.block.client.globals would be the property name used for Customer Service application
Create similar for your scope an set it with false
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
yes the above script disables right click on form but users can still inspect the page using developer tools (shortcut from chrome or other browsers)
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
