Show a Loading Spinner with UI Blur During Long-Running Actions

When performing long-running actions in a NetSuite Suitelet or Client Script — such as generating files, calling APIs, or triggering downloads — it’s good practice to show a loading indicator and block the UI to avoid user interaction. Here’s a reusable snippet that creates a full-screen blur overlay and centered loading GIF (spinner). Why Use… Continue reading Show a Loading Spinner with UI Blur During Long-Running Actions

Steps to Add Processing Animation Using SweetAlert2

Include SweetAlert2 Library: You can host the SweetAlert2 files in your NetSuite File Cabinet or use a CDN. function OnPageInit() { AddJavascript(‘https://cdn.jsdelivr.net/npm/sweetalert2@11’, ‘head’); AddStyle(‘https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css’, ‘head’); } function AddJavascript(jsname, pos) { var tag = document.getElementsByTagName(pos)[0]; var addScript = document.createElement(‘script’); addScript.setAttribute(‘type’, ‘text/javascript’); addScript.setAttribute(‘src’, jsname); tag.appendChild(addScript); } function AddStyle(cssLink, pos) { var tag = document.getElementsByTagName(pos)[0]; var addLink =… Continue reading Steps to Add Processing Animation Using SweetAlert2

Automatic Page Reload/Refresh in Client Scripts

Refreshing a web page without user interaction can be achieved using the window.location.reload() function in client-side JavaScript. This function reloads the current page, causing any changes made to the underlying data or UI to be reflected instantly to the user. One common scenario where this functionality is useful is in web applications that rely heavily… Continue reading Automatic Page Reload/Refresh in Client Scripts