- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
This error happens because the relevant for you widget server script is trying to call .toString() on a value that isn’t actually a native string.....which in servicenow often means a java/rhino object is being treated like a javascript string and causes this method incompatibility.....
so the fix is to review the widget server script and any script include it calls, ensure you aren’t calling .toString() directly on returned objects or arrays and instead safely coerce to a string or use primitive getters.....or adjust the script logic so it handles the data type correctly...... because servicenow throws this error when toString is used on incompatible objects rather than native strings......
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Technical Consultant/Developer