When you use script parameters, you can specify a preference type. Available preference types are Company and User or you can choose not to set a preference. Company: If the preference is set to Company, the parameter’s value is read from the value set in Setup > Company > Preferences > General Preferences in the Custom Preferences tab.… Continue reading Setting Script Parameter Preferences
Author: Swathi Krishna K S
Generic Function to Collapse/Expand Sublist Fields with Dynamic Button Label in Suitelet Using JQuery
Overview: This generic JavaScript function enables the collapsing and expanding of sublist columns on a Suitelet page. It dynamically changes the button label between “Expand” and “Collapse” based on the visibility of the sublist columns. This function can be reused and customized according to the specific field and button identifiers used on different Suitelet pages.… Continue reading Generic Function to Collapse/Expand Sublist Fields with Dynamic Button Label in Suitelet Using JQuery
Calculating Date Differences in SuiteScript
This article provides a reusable SuiteScript 2.x utility function to calculate the number of days between two dates. The function ensures proper date parsing using NetSuite’s N/format module and includes error handling, input validation, and logging. Usage Accepts two date strings in MM/DD/YYYY or NetSuite’s UI format. Converts them into Date objects. Computes the difference… Continue reading Calculating Date Differences in SuiteScript
NetSuite Saved Search Formula: Identifying Records Created Within the Past Year
When working with NetSuite Saved Searches, you may need to filter records based on their creation date. A common requirement is to find records created within the past 12 months. This can be achieved using a Formula (Numeric) field in a NetSuite Saved Search. Formula to Identify Records Created in the Last 12 Months: CASE… Continue reading NetSuite Saved Search Formula: Identifying Records Created Within the Past Year
Understanding the Behavior of “View from Order Only” Setting on Transaction Line and Body Custom Fields
The Applies To subtab of transaction body and transaction line custom fields have settings for Item Receipt and Item Fulfillment fields. These settings have associated View from Order Only fields. Checking a View from Order Only box does the following: (Item Receipt) View from Order Only – makes this custom field always display the value… Continue reading Understanding the Behavior of “View from Order Only” Setting on Transaction Line and Body Custom Fields
Resolving the “SSS_INVALID_SRCH_COL” Error in Client Script Due to Search Permis
Issue: While using a saved search in a Client Script you encounter the following error in the browser’s console: An unexpected error occurred in a script running on this page. customscript_mhi_ibS_quote_conv_cs (pageInit) JS_EXCEPTION SSS_INVALID_SRCH_COL An nlobjSearchColumn contains an invalid column, or is not in proper syntax: custcol_mhi_ibs_opportunity_key. This error occurs when the saved search, which… Continue reading Resolving the “SSS_INVALID_SRCH_COL” Error in Client Script Due to Search Permis
How to Add Days to a Date Using a Formula in NetSuite
In NetSuite, you can easily perform date arithmetic within saved searches by using Formula (Date) or Formula (Numeric) fields. The `INTERVAL` keyword allows you to add a specific number of days to a date. This is particularly useful when you need to adjust dates for calculations or comparisons in your reports. Formula Syntax for Adding… Continue reading How to Add Days to a Date Using a Formula in NetSuite
Managing Field Layout in Suitelets Using serverWidget.FieldLayoutType
In Suitelets, managing the position and alignment of fields on the form is essential for creating a well-organized user interface. One key way to control field positioning is by using the serverWidget.FieldLayoutType enum in SuiteScript, which helps determine how fields are arranged on the page. — The serverWidget.FieldLayoutType is an enum in NetSuite SuiteScript 2.x… Continue reading Managing Field Layout in Suitelets Using serverWidget.FieldLayoutType
Saved Search Formula for Comparing two fields with different data types
When comparing values from different columns in NetSuite (e.g., Vendor Offered Quantity and Request Quantity), you might encounter issues due to datatype mismatches. A common issue is when one of the columns is stored as a string while the other is numeric, leading to incorrect comparisons. To ensure accurate comparison, you can use the TO_NUMBER… Continue reading Saved Search Formula for Comparing two fields with different data types
SuiteScript 2.0 > Client Script > Display a Saved Search’s result in a popup alert dialog using inline-HTML-created table
Scenario User/Customer wants to display a saved search’s result in a popup dialog alert for a quick reference, depending on their business use case. Additionally, an inline-HTML-created table will be used in containing the search results for better display. Solution Below is a sample script for displaying the popup dialog alert, triggered on pageInit function. The… Continue reading SuiteScript 2.0 > Client Script > Display a Saved Search’s result in a popup alert dialog using inline-HTML-created table