In some case if we are creating the custom record to store the confidential information like username and password. We need to restrict the particular custom record to be accessible only to the particular role. Step 1: Create/Edit the custom record and select the Access Type to Use Permission List Step 2: Under the Permissions… Continue reading Permission setting for accessing the particular custom record
Author: Harish Kanna S
Updating the existing records without using Mass update script.
We implement the User Event Script in after submit action to perform some field changes. How can we make that change in the existing records? In case if there are a greater number of existing records, we can’t edit each record to perform the User Event script. Instead of that we are using Mass Update… Continue reading Updating the existing records without using Mass update script.
Difference Between context.response.writePage and context.response.writeFile
context.response.writePage -> While we are creating the form and you want to display a UI page using the SuiteLet -> Used with the N/ui/serverWidget module to create forms, lists, or sublist Syntax: let form = serverWidget.createForm({ title: ‘My Sample Form’ }); form.addField({ id: ‘custpage_textfield’, type: serverWidget.FieldType.TEXT, label: ‘Enter Some Text’ }); form.addSubmitButton({ label: ‘Submit’ });… Continue reading Difference Between context.response.writePage and context.response.writeFile
Button click display/download PDF as response using SuiteLet
In some case in transaction record the client may request to download the invoice in multiple format templates according to the customer category. We can create multiple format templates of invoices. But at default we can set one template. In this case we can create a button on the sales order record while clicking on… Continue reading Button click display/download PDF as response using SuiteLet
Applying the custom script in the online form.
We create an online form for the client’s requirement to create a lead, etc., without NetSuite access. In that form, we need to implement some validation without impacting the standard NetSuite lead record. We deploy the script file only on the online form. In the online form, under the Custom Code tab, we can add… Continue reading Applying the custom script in the online form.
Identifying the WSDL version for the SOAP Web service update
Sometimes, we need to update the WSDL version for the smooth running of the SOAP integration. Example: Recently, for the 2025.1 NetSuite version update, it is scheduled to disable the 2018_1 WSDL version, and it will return the response as “INVALID_VERSION.” In that scenario, we need to update the old version to the current supporting… Continue reading Identifying the WSDL version for the SOAP Web service update
Use cases of Object.entries method in SuiteScript
Object.entries() is a JavaScript method used to return an array of a given object’s own enumerable string-keyed property [key,value] pairs. It is useful when working with objects dynamically. Syntax: let customerData = { name: ‘John Doe’, email: ‘johndoe@example.com’, phone: ‘123-456-7890’ }; Object.entries(customerData).forEach(([key, value]) => { log.debug(‘Customer Data’, key + ” = “ + value); });… Continue reading Use cases of Object.entries method in SuiteScript
REST API and RESTlet
In NetSuite, both REST API and RESTlet are used to interact with external systems and perform operations like creating, reading, updating, and deleting data. But they have some differences: REST API in NetSuite: (Representational State Transfer) Standard API: It’s a built-in system that follows a standard format (REST) for working with NetSuite data. Easy to… Continue reading REST API and RESTlet
Defining Objects contains multiple related functions
In the case of developing code with a larger number of lines, we use functions for reusability. In some cases, when we need to create multiple functions, it is essential to maintain an easy understanding of our script. To achieve this, we can group the functions under their corresponding object. //Creating an object that organize… Continue reading Defining Objects contains multiple related functions
N/task module guide.
Supported Script Types: Server Scripts The N/task module is used to create and manage background tasks such as Scheduled Scripts, Map/Reduce Scripts, CSV Imports, and Query Tasks. //Creating the task to perform the scheduled script let scriptTask = task.create({ taskType: task.TaskType.SCHEDULED_SCRIPT, scriptId: ‘customscript_my_scheduled_script’, deploymentId: ‘customdeploy_my_deployment’ }); let taskId = scriptTask.submit(); without calling task.submit(), the scheduled… Continue reading N/task module guide.