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

PrashantLearnIT
Giga Sage

Hi @Aki18 

 

Ideally, that's not recommended, but can you please explain what you are trying to achieve?

********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************

Hi @PrashantLearnIT ,


Thank you for your reply. I would like to prevent users from checking page source of the record.

Aki18_0-1762348077991.png

 

Hi @Aki18 

 

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]

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

@PrashantLearnIT 

I created the following onLoad Client Script for Incident table with "Isolate script" = "false" and it successsfully blocked the browser's right-click.
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());
}