Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Any way to prevent right-click on table forms?

Aki18
Tera Contributor

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

13 REPLIES 13

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Aki18 

You can’t hide it as far as I know, but you can customize it.

 

https://www.servicenow.com/docs/bundle/zurich-platform-user-interface/page/use/using-forms/concept/c...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @Dr Atul G- LNG 
Thank you for your reply. I would like to prevent users from checking page source of the record. Is there any way to make customization for that?

Aki18_0-1762348077991.png

 

No, we can't. 

That’s browser-level, not from ServiceNow, so we can’t control it much here.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

@Dr Atul G- LNG 

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());
}

 

 

Hi @Aki18 

 

As I said it is browser level settings which I doubt we can control, so better keep it like this and avoid customisation and technical debt.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************