typeerror: cannot read property

claystroup
Tera Guru

Users are receiving  error 'My time entry field encountered the following error: TypeError: Cannot read property 'style' of underined.' when viewing closed tickets. Users with admin rights do not receive the error when viewing the same tickets, only users with itil role and no admin role receive the error, and only on closed, not open, tickets. Does anyone have a fix for this issue?

1 ACCEPTED SOLUTION

Thank you Dravvy!



Your reply wasn't the specific answer to my issue but it put me on the right track. I searched the included scripts and business rules on the INC tickets and found several System Client Scripts that had the exact error scripted into them;



catch(e) {


  g_form.addErrorMessage('My time entry field encountered the following error: ' + e + '.\nPlease contact support.');



I believe the issue is that the none in



inputControlsEl[0].style.display = 'none';



is in single, not double quotes, but it's another team's script, so I passed it to them to fix.



Thank you for putting me on the track to finding the issue!


View solution in original post

5 REPLIES 5

oharel
Kilo Sage

Hi Clay,



I had a similar issue with a client script where I used DOM manipulation.


I am not sure it is directly related to what you have, but maybe you can share your script?



Harel


Hi Harel,



Thank you for your reply. I don't know what script is being affected, it happens when someone with itil role but no admin role views a closed INC ticket. They receive a red banner at the top of the ticket view with that error. I get the same when I impersonate them, but not when I use my logon or impersonate another user with admin role.


Hi Clay,



There was a similar issue in the past.


ServiceNow KB: PRB657798: Function toggleHelp() on catalog client scripts throws JavaScript errors i...



Please do a search in yr script include and Business rule and search for script contains (wrapper.style.display=="block")



If you have such script that has this then follow the workaround in the script.



Thanks,


Dravvy



Please Hit like, Helpful or Correct depending on the impact of the response


Thank you Dravvy!



Your reply wasn't the specific answer to my issue but it put me on the right track. I searched the included scripts and business rules on the INC tickets and found several System Client Scripts that had the exact error scripted into them;



catch(e) {


  g_form.addErrorMessage('My time entry field encountered the following error: ' + e + '.\nPlease contact support.');



I believe the issue is that the none in



inputControlsEl[0].style.display = 'none';



is in single, not double quotes, but it's another team's script, so I passed it to them to fix.



Thank you for putting me on the track to finding the issue!