api.data.get_special_handling_notes.refresh is not a function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 12:35 PM
UI Builder. Recently updated to Vancouver. A number of my pages are now throwing this type error--not obvious in UI, seeing it in the console.
VM494:20 Uncaught TypeError: api.data.get_special_handling_notes.refresh is not a function
at eval (eval at <anonymous> (evaluator.js:37:10), <anonymous>:20:45)
The page I was working on had mysterious new problems (events not hitting when they should and used to), so I managed to track it down to the following code:
(function anonymous(proxy
) {
with(proxy){ return (function(){"use strict";
return (/**
* @Param {params} params
* @Param {api} params.api
* @Param {event} params.event
* @Param {imports} params.imports
* @Param {helpers} params.helpers
*/
function recordDataFetchCompleted({
api,
helpers,
event,
imports
}) {
if (api.state.specialHandlingNotesDisplayed) return;
helpers.timing.setTimeout(() => {
api.data.get_special_handling_notes.refresh(); //Explicit invoke the DB of SHN
}, 3000);
});})() }
})
I have no idea what this code is, or why I am hitting it, of course. These pages have upgraded through a few S'Now versions. In a rare occurrence related to code I have no control over, I was able to implement a workaround! I created a boolean CSP called specialHandlingNotesDisplayed and set it to true--thus on this particular page I am no longer throwing the errors and my missing events are hitting again. (That is, no longer in Dev, still happening in Prod, and in the other pages where it occurs.)
Anybody know anything about this and how I could get rid of this function call?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 01:01 PM
It looks like it's trying to refresh a data resource called get_special_handling_notes. Does that data resource exist on your page? If you've upgraded and this just started happening on an OOTB workspace page I'd open a support case as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 10:28 AM
Thank you, @Brad Tilton. It was built from an OOTB template for sure, I would think the blank one (but don't know how to verify that). It has a Standard record data resource and a UI Controller Record Page data resource--I would think added by the Form component preset. A "portal experience" page. No get_special_handling_notes data resource. (While I ignore a lot of what it puts in there so long as it doesn't get in my way, I have enough sense not to delete.) So I'll call it an upgrade failure and just be glad I was able to find the workaround. (As with so many of us, no doubt, I don't have direct access to create ServiceNow support tickets--I have to ask my internal people. I save my chips for this for desperate times, and workaround so not desperate, this one.)