Resolving JSONP Execution Issue in NetSuite After 2025.1 Release

After the NetSuite 2025.1 release, some users encountered an issue where JSONP script execution failed due to a MIME type restriction. This issue affected Suitelet-based JSONP responses that were previously functioning correctly. This article explains the cause of the issue and provides a solution. Issue Description When executing a JSONP request from a NetSuite Suitelet,… Continue reading Resolving JSONP Execution Issue in NetSuite After 2025.1 Release

Call suitelet through post request using after submit in UserEvent Script

  const afterSubmit = (scriptContext) => {             if (scriptContext.type !== scriptContext.UserEventType.EDIT) return;             try {                 let noteRecord = scriptContext.newRecord;                 let noteId = noteRecord.id;          … Continue reading Call suitelet through post request using after submit in UserEvent Script

Trigger a workflow state on button click in the suitelet page

The following scripts can be used to trigger a workflow state in a record by clicking the button in a suitelet page: Parent Suitelet: /**  * @NApiVersion 2.1  * @NScriptType Suitelet  */ define([‘N/ui/serverWidget’, ‘N/url’, ‘N/runtime’], function(serverWidget, url, runtime) {     function onRequest(context) {         if (context.request.method === ‘GET’) {    … Continue reading Trigger a workflow state on button click in the suitelet page

Function to handle “Error Parsing XML: The entity name must immediately follow the ‘&’ in the entity reference” error

When following error is obtained: “Error Parsing XML: The entity name must immediately follow the ‘&’ in the entity reference.”, Use the escapeSpecialChar function function escapeSpecialChar(textvalue) {             try {                 textvalue = textvalue.replace(/&/g, ‘&’);                … Continue reading Function to handle “Error Parsing XML: The entity name must immediately follow the ‘&’ in the entity reference” error

Simplify Item Fulfillment Management with a Custom NetSuite Suitelet

Overview Managing Item Fulfillments in NetSuite can be challenging, especially when external stakeholders, such as shipping companies, need access to specific data. A custom Suitelet can streamline this process by providing a user-friendly interface to retrieve and filter Item Fulfillments based on Sales Orders and locations. This Suitelet eliminates the need for manual intervention, making… Continue reading Simplify Item Fulfillment Management with a Custom NetSuite Suitelet

Prefilling Form Fields Dynamically Using Form.updateDefaultValues

The Form.updateDefaultValues(options) method in SuiteScript 2.x is used to set or update the default values for fields in a Suitelet form. This is a convenient way to prefill form fields with specific values before they are presented to the user, enhancing usability and efficiency. Method Syntax form.updateDefaultValues(options); Below is an example of how to use… Continue reading Prefilling Form Fields Dynamically Using Form.updateDefaultValues

Write User and Session Information to the Response

A Suitelet to write user and session information for the currently executing script to the response: Solution: /**  * @NApiVersion 2.x  * @NScriptType Suitelet  */ // This script writes user and session information for the currently executing script to the response. define([‘N/runtime’], function(runtime) {   function onRequest(context) {     var remainingUsage = runtime.getCurrentScript().getRemainingUsage();     var userRole = runtime.getCurrentUser().role;… Continue reading Write User and Session Information to the Response

Suitelet Basics: Introduction to Building Custom Integrations in NetSuite

Suitelets are a powerful tool within the NetSuite platform that allow developers to create custom user interfaces and server-side scripts. Suitelets extend the capabilities of NetSuite by providing a way to interact with external systems, collect input, display data, or create custom processes that aren’t available through standard NetSuite functionality. In this article, we’ll explore… Continue reading Suitelet Basics: Introduction to Building Custom Integrations in NetSuite

Suitelet sample for fetching and displaying values from an external API in a Suitelet page

Suitelet Script /** * @NApiVersion 2.1 * @NScriptType Suitelet */ define([‘N/ui/serverWidget’, ‘N/https’],     (serverWidget, https) => {           const onRequest = (scriptContext) => {             try {                 if (scriptContext.request.method === ‘GET’) {          … Continue reading Suitelet sample for fetching and displaying values from an external API in a Suitelet page

Pagination in a Suitelet page using a SELECT field in the form to select page number – Simplified

This code will dynamically change the data according to the selected page number using Suitelet and Client Scripts. Sample search is used in the code ni order to set the sublist values. Suitelet code: Create a select field for pagination let selectPageField = form.addField({ id: ‘custpage_page_select’, type: serverWidget.FieldType.SELECT, label: ‘Select Page’ }); // Get current… Continue reading Pagination in a Suitelet page using a SELECT field in the form to select page number – Simplified