Suitelets and UI Object Best Practices

The following are best practices for Suitelet development using UI objects and custom UI. General Suitelets are ideal for generating NetSuite pages (forms, lists), returning data (XML, text), and redirecting requests.Limit the number of UI objects on a page (< 100 rows for sublists, < 100 options for on demand select fields, < 200 rows… Continue reading Suitelets and UI Object Best Practices

Fetch the workflow field values related to the record deployed in suite-script using a saved search

Recently I had to fetch the values of workflow fields from within a Suitelet that is triggered by a button action. Workflow fields can be updated based on field value updates in a NetSuite record but there is no direct way of fetching these values in a script. For this, I used a saved search… Continue reading Fetch the workflow field values related to the record deployed in suite-script using a saved search

Record has Changed in Sales Order due to SuiteScript

The user is encountering the error: “Record has Changed” or “The record has been edited since you retrieved it” when trying to save a Sales Order. There is a script that updates all Item Fulfillment records (related to the Sales Order) to ‘Shipped’ before saving the Sales Order record and being able to create an Invoice afterwards Solution: These errors are due to the updates done to the Item… Continue reading Record has Changed in Sales Order due to SuiteScript

Resolve Error: “INVALID_TYPE_1_USE_2” for Custom Date/Time Field on Suitelet page if get values from client script

Description An error occurred in the script while running the suite let page after adding the date filters to get the results. SOLUTION: Use N/format module *** Get the custom date using the data type Value *** var fromDateRecValue = context.currentRecord.getValue({ fieldId: ‘custpage_fromdate’ }); *** Change the value to date format *** var fromDateRec =… Continue reading Resolve Error: “INVALID_TYPE_1_USE_2” for Custom Date/Time Field on Suitelet page if get values from client script

Map Reduce Script

Map/Reduce script is an alternative to a scheduled script which can handle/process a large amount of data. It is best suited for scenarios where data can be divided into small and independent parts. When the script is executed, a structured framework automatically created enough jobs to process all of these parts. No need to manage… Continue reading Map Reduce Script

How to implement a script library file in NetSuite

We can store global variables and functions inside a script library file in NetSuite. This helps to easily use a function or variable in multiple script records without defining the same for each record. For example, we can store global variables such as email addresses and commonly used functions inside a library file and access… Continue reading How to implement a script library file in NetSuite