Function to create deployment and execute the script through script.

  The following functions can be used to create a new script deployment and execute the script.   /**      * A function that create Deployment and execute the script.      *      * @return {String} The Task ID from NetSuite.      */     function createAndExecuteDeployment(options)     {  … Continue reading Function to create deployment and execute the script through script.

Translate text using N/machineTranslation Module

Use the N/machineTranslation module to translate text into supported languages using generative AI. This module uses the Oracle Cloud Infrastructure (OCI) Language service to translate text in documents you provide. You can also use the N/llm Module to translate text by providing a suitable prompt when calling generative AI methods (such as llm.generateText(options)). However, using the N/machineTranslation module… Continue reading Translate text using N/machineTranslation Module

Handling Timezone Conversion When Setting Date Fields in NetSuite via Map/Reduce Scripts

Purpose This article explains how to handle timezone discrepancies when setting date fields in NetSuite via a Map/Reduce script, especially when using ISO 8601 UTC date strings from external systems. This ensures the correct calendar date appears in the NetSuite UI, regardless of the account’s timezone configuration. Problem Overview External systems often send date values… Continue reading Handling Timezone Conversion When Setting Date Fields in NetSuite via Map/Reduce Scripts

Excluding Kit Components in Sales Order Item Queries

To retrieve transaction details, including item and quantity information from the transaction line, we can use query on the transaction line table. By default, this query will include both standalone items and components of Kit Items. To exclude Kit Item components and return only the items listed on the sales order, include the following condition… Continue reading Excluding Kit Components in Sales Order Item Queries

APIs for NetSuite Clutch Integration

Here are the APIs available for updating customer reward points in Clutch: To add reward points to customer: curl –location ‘https://{endpoint}/merchant/updateBalance’ –header ‘authorization: Basic {Authorization code}’ –header ‘brand: SME8953’ –header ‘location: SMEECOMM’ –header ‘terminal: SMEECOMMWS’ –data ‘{ “cardNumber”: “1234593316630193”, “action”: “issue”, “amount”: { “amount”: “882”, “balanceType”: “Points” } }’ To redeem reward points to customer:… Continue reading APIs for NetSuite Clutch Integration

API to fetch the Quote from the Nutanix

curl –location ‘https://{domain}/frontline/v1/distributor/quotes?quoteNumbers=XQ-182951′ –header ‘x-frontline-jwt: {JWT Token}’ –header ‘Authorization: {JWT Token}’ Select the following in the Auth in Postman Auth type: JWT Bearer Algorithm: RS256 Private key: upload private key

Displaying Child Record Data on a Parent Custom Record PDF

To display child record information within the printed PDF of a parent custom record, follow this approach using SuiteScript and Advanced PDF/HTML templates: Steps to Implement Deploy a User Event Script on the Parent Custom Record Within the beforeLoad function, ensure the script executes only when the context is CONTEXT.PRINT. Generate a Virtual Sublist with… Continue reading Displaying Child Record Data on a Parent Custom Record PDF

Function to get the latest currency exchange rate

  /**        * Function to get the latest currency exchange rate based on base currency (HKD) and transaction currency(USD)        * @param baseCurrency        * @param sourceCurrency        * @return exchangeRate        **/       function getExchangeRate(baseCurrency, sourceCurrency) {         try {           let exchangeRate = 0;               let currencyrateSearchObj = search.create({             type: “currencyrate”,             filters:               [                 [“basecurrency”, “anyof”, baseCurrency],                 “AND”,                 [“transactioncurrency”, “anyof”,… Continue reading Function to get the latest currency exchange rate

Error: “Empty invocation target! “

The error “Empty invocation target!” appears when attempting to hide sublist fields in the sales order. Reason: This error occurs because the field is not applied to the sales order form. Solution: To resolve the issue, retrieve the available sublist fields in the sales order and verify whether the field intended to be hidden is… Continue reading Error: “Empty invocation target! “