Shob S
06/12/2025, 7:34 PMdefine([], function () {
function clientfunc(){}
function pushErrorToCache(errorObj) {
// Lazy load to avoid client-side errors
require(['./ErrorUtils'], function (ErrorLogger) {
ErrorLogger.pushErrorToCache(errorObj);
});
}
function newfunctionusingcache(rec, fieldId, value) {
try {
} catch (e) {
const errorObj = {
fieldId,
value,
message: e.message
};
pushErrorToCache(errorObj);
}
}
return {
newfunctionusingcache,clientfunc
};
});
creece
06/12/2025, 7:52 PMehcanadian
06/12/2025, 7:53 PMrequire
N/cache itself.Shob S
06/12/2025, 7:55 PMrequire
the cache in the same file, but since "errorutil" contains a lot of other logic, moved thereehcanadian
06/12/2025, 8:02 PMlet cache;
try {
if (runtime.executionContext !== runtime.ContextType.CLIENT && runtime.executionContext !== runtime.ContextType.USER_INTERFACE) {
require(['N/cache'], (c) => {cache = c});
}
} catch (e) {
cache = null;
}
ehcanadian
06/12/2025, 8:04 PMShob S
06/12/2025, 8:10 PMAnthony OConnor
06/12/2025, 8:23 PMehcanadian
06/12/2025, 8:25 PMAnthony OConnor
06/12/2025, 8:27 PMMarvin
06/13/2025, 9:36 AMShawn Talbert
06/15/2025, 2:41 AMShawn Talbert
06/15/2025, 2:42 AMShob S
06/16/2025, 1:28 AM