/** * @NApiVersion 2.1 * @NScriptType Suitelet */ /************************************************************************************************ * Hygiene Technologies NZ-NS * * HTNZ-155 : KPI Dashboard * * ********************************************************************************************** * * Author: Jobin and Jismi IT Services * * Date Created : 24-August-2023 * * Description : Suitelet Page For the Dynamic connection to Excel * * REVISION HISTORY * * @version… Continue reading Excel – KPI Dashboard Connection using Script
Tag: Suitescript
SSS_TIME_LIMIT_EXCEEDED
This error is thrown if a single execution of a server-side script or application has taken longer than its limit. The following table lists the prescribed time limits for each script type or application: Note: A script may execute for a long time if any or all of the following occur: The script performs a large… Continue reading SSS_TIME_LIMIT_EXCEEDED
N/format Module for Date Formatting
The n/format module helps to parse formatted data into strings and to convert strings into a specified format. A string can be formatted to a raw Date object, and then parses it back to the formatted string. The following code snippet demonstrates the above: let initialDate = “07/31/2024”; let parsedDate = format.parse( { value: initialDate, type:… Continue reading N/format Module for Date Formatting
SuiteScript Best Practices
Always thoroughly test your code before using it on your live NetSuite data. Type all record, field, sublist, tab, and subtab IDs in lowercase in your SuiteScript code. Prefix all custom script IDs and deployment IDs with an underscore (_). Do not hard code any passwords in scripts. The password and password2 fields are supported… Continue reading SuiteScript Best Practices
Suite Script Unit Test
Should the script be deployed to All Users/Subsidiaries/Roles/Departments/Contexts? Should the permission level be Current Role/Admin/Specific Roles? Should there be empty/unnecessary entry points on the script? Does the User Preference have an impact on the customization? For example: User Date Preference is different from company preference. The date format can be changed on the user preferences… Continue reading Suite Script Unit Test
Common issues and solutions with SuiteScript
If you’re facing issues with SuiteScript, it can be due to a variety of reasons, from syntax errors to misconfigured script deployments. Here are some common issues and solutions: Script Execution Errors Issue: Scripts fail to execute due to syntax errors or incorrect API usage. Solution: Use the SuiteScript Debugger and nlapiLogExecution to identify and… Continue reading Common issues and solutions with SuiteScript
N/task Module
The N/task module in SuiteScript 2.0 is used for managing tasks such as map/reduce jobs, scheduled scripts, and other task-based processes within NetSuite. This module allows you to create, submit, and check the status of these tasks programmatically. A brief overview of what you can do with the N/task module: Map/Reduce Script: This type of… Continue reading N/task Module
Showing the suitelet data using Iframe
Resolve the URL of the Suitelet script let suiteletUrl = url.resolveScript({ scriptId: ‘customscript_jj_sl_individualsales_rank’, deploymentId: ‘customdeploy_jj_sl_individualsales_rank’ }); Set the HTML content with the Suitelet URL … Continue reading Showing the suitelet data using Iframe
Change a Sublist Field Property Using SuiteScript 2.0
When using method isDisabled and an error is encountered, there is a workaround that involves using a different approach with updateDisplayType method. /** * @NApiVersion 2.x * @NScriptType UserEventScript */ define([], function() { function beforeLoad(scriptContext) { scriptContext.form.getSublist(‘item’).getField(‘description’).updateDisplayType({displayType:’disabled’}); … Continue reading Change a Sublist Field Property Using SuiteScript 2.0
Resolve Error “Custom Module Call Undefined” in SuiteScript 2.0
In SuiteScript 2.0, make sure to beautify or format your code to avoid undefined calls from the originating script. define([‘N/error’, ‘N/file’, ‘N/format’, ‘N/https’, ‘N/record’, ‘N/render’, ‘N/runtime’, ‘N/search’, ‘N/xml’], function(error, file, format, https, record, render, runtime, search, xml) { function execute(scriptContext) { var cmsearch = search.load( { id: ‘customsearch42’ … Continue reading Resolve Error “Custom Module Call Undefined” in SuiteScript 2.0