TypeError: Cannot read properties of null (reading 'document'): function () { [native code] }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2024 03:55 AM
Hi All,
I am using an onsubmit client script like below, which is throwing the below error in native UI when I am making any updates to the record.
Please help me here what is wrong
TypeError: Cannot read properties of null (reading 'document'):
function () { [native code] }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2024 06:37 AM
It seems like the error is caused by the this.document... line, even though it shouldn't be running that in the native UI due to the window == null condition. Confirm that Isolate script is unchecked, and the UI Type = All. An alternate method of identifying when portal is being used is
if (typeof parent.angular != 'undefined') { // portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2024 07:40 PM
Hi @Brad Bowman
yes isolate script is unchecked and ui type is set to all already
now i have added the alternate method of identifying portal but still it is throwing the same error in native view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 05:24 AM
If you comment only the if line containing this.document, and the closing } does it run without error? If so, do you get the text of the portal or native ErrorMessage - or both?