- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2023 03:28 AM
Hi Experts,
I have cloned OOTB widget : Knowledge Bases Browse
im getting error : ErrorServer JavaScript error Method "toString" called on incompatible object.
in line number 2 of below script, Please suggest,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2023 08:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2023 06:10 AM
did you debug what came as return value of that function?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2023 06:25 AM
when i try the function, it throws an error "unterminated string literal"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2023 07:54 AM
did you add gs.info() and check what came in logs?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2023 06:46 AM
It also looks like a copy of the KBPortalService script include is copied as well; line 1 in the script you posted.
The error suggests that the method ".toString()" is being called which does not seem to be within the posted script.
This leads me to believe that the error may be somewhere inside the "CopyKBPortalService" as this would also point to line 2 if there is an error there because it's being used on line 2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2023 08:04 AM