Getting "cannot read properties of null (reading parentNode)" error
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 08:01 AM
I have written a onLoad client script to hide an annotation along with the fields inside it.
if (cmdbtableservice == 'cmdb_ci_computer')
{
document.getElementById("functionalresponsible").parentNode.style.display = "none";
document.getElementById("operationalresponsible").parentNode.style.display = "none";
g_form.setMandatory('u_administrated_by', false);
g_form.setDisplay('u_administrated_by', false);
}
Now I tried to debug the script via developer tool and there I put breakpoint on line no 3 and get the below message.
Though this same script is working on another instance.
Can anyone please help me on this.
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 08:06 AM
@Ap_1 If this script is working on the other instance and not in your instance then need to check following things.
1. Script should be in the Global scope
2. Isolate script checkbox on the script form should be unchecked.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 08:29 AM
Script is in global scope an isolate script is unchecked only.