Swal.fire is a method from the SweetAlert2 library, which is a popular JavaScript library for creating beautiful, customizable alert boxes. It provides a more attractive and user-friendly alternative to standard JavaScript alert dialogs, allowing developers to create responsive and accessible popups with various options and styles. Key Features of Swal.fire Customizable Alerts: Developers can customize… Continue reading Customizable Alerts using swal.fire
Category: SuiteScript Functions
SuiteScript Functions related articles will be posted in this category
Upcoming changes in 2025.1 to how audience roles are defined for script deployments
Upcoming changes to how audience roles are defined for script deployments. What is Changing? For NetSuite 2025.1 accounts, starting March 13, 2025, you will no longer be able to deploy scripts to both internal and external roles by completing either of the following actions: * Checking the Select All box in the Audience subtab in… Continue reading Upcoming changes in 2025.1 to how audience roles are defined for script deployments
Error When Accessing Child Records in Sublist via Client Script with Limited Permissions
Issue When a client script attempts to access or manipulate a child record on a sublist (e.g., line items on a transaction), an error occurs if the user’s role has only “Create” permission for the child record type and “Edit” permission for the parent record. The error typically indicates a permission violation, such as: “You… Continue reading Error When Accessing Child Records in Sublist via Client Script with Limited Permissions
jQuery Browser Support
Current Active Support Desktop Chrome: (Current – 1) and Current Edge: (Current – 1) and Current Firefox: (Current – 1) and Current, ESR Internet Explorer: 9+ Safari: (Current – 1) and Current Opera: Current Mobile Stock browser on Android 4.0+[1] Safari on iOS 7+[1] [1]: Workarounds for Android Browser 4.0-4.3, iOS 7 & iOS 10… Continue reading jQuery Browser Support
Currency conversion Suitescript using Currency Module
currency.exchangeRate : Enter an exchange rate for this currency against the base currency of this company, or if you use OneWorld, for this currency against the base currency of the root parent subsidiary. For example, if your company is located in Canada and you are defining the U.S. dollar, and the current exchange rate is… Continue reading Currency conversion Suitescript using Currency Module
Show Custom Alert using HTML in suitelet
Function Description: showCustomModal The showCustomModal function is dynamically added to the HTML during page rendering. It is designed to display custom alert messages such as warnings or errors without redirecting the user. The function is included in the HTML output, making it callable anytime within the page. Function Purpose This function creates a pop-up modal… Continue reading Show Custom Alert using HTML in suitelet
Best Practices to Handle Governance in a Map/Reduce Script
Handling governance efficiently in a Map/Reduce script ensures smooth execution without hitting NetSuite’s API limits. 1. Get (Load) Input Data Stage This stage fetches data to process in the script. Best Practices: Use search.create().runPaged() instead of run() to process large datasets efficiently in batches. Avoid unnecessary field retrievals; use search.lookupFields() instead of record.load() when only… Continue reading Best Practices to Handle Governance in a Map/Reduce Script
Governance Usage in Each Stage of Map/Reduce Script
Map/Reduce scripts have four stages: Get (Load) Input Data, Map, Reduce, and Summarize. Each stage has different governance considerations. 1. Get (Load) Input Data Stage This stage fetches data to process in the script (e.g., search results, JSON data, file parsing). Governance Considerations: search.create().run().each() → 10 units per record search.lookupFields() → 1 unit per record… Continue reading Governance Usage in Each Stage of Map/Reduce Script
Common Function for Updating NetSuite Record Fields using record.submitFields
Function to Update Record Fields /** * Common function to update record fields using record.submitFields * @param {string} recordType – The type of the record (e.g., ‘customer’, ‘salesorder’) * @param {string} recordId – The internal ID of the record * @param {Object} fieldValues – Key-value pairs of fields to update * @returns {string} – The… Continue reading Common Function for Updating NetSuite Record Fields using record.submitFields
Invalid type NaN, use Date” Error When Using N/format
Introduction When working with the N/format module in NetSuite, you may sometimes encounter the error: “Invalid type NaN, use Date” This error typically occurs when trying to format a value that is not recognized as a valid Date object. It usually happens when passing an undefined, null, or incorrectly formatted string instead of a proper… Continue reading Invalid type NaN, use Date” Error When Using N/format