Recently, I had to add a custom field to the company information page in NetSuite. The ‘Company Information’ page can be accessed using the ‘SetUp> Company> Company Information’ navigation and is only available for the admin role by default. If you want to store some constant values for customization and do not want normal users… Continue reading How to add a custom field to ‘company information’ page in OneWorld and Non-OneWorld NS accounts
Author: Derin Jose
Adjust visibility of columns in React JS Material UI-X Data Grid element
The React JS Material UI-X library has the Data Grid module for displaying data as a table. The requirement was to set the visibility of certain columns in the data grid to hidden with an option for the user to make it visible through UI. If we filter the data from the data source, user… Continue reading Adjust visibility of columns in React JS Material UI-X Data Grid element
Filter search data based on the logged in employee record field value
The requirement is to filter the data returned from a saved search based on the custom field inside the employee record of the currently logged-in NetSuite user(employee). For this, the logged-in user ID must be fetched using the N/runtime module. I am passing the user internal ID as a global variable ‘userID’. Sample code for… Continue reading Filter search data based on the logged in employee record field value
Function to create a file name for exported Excel document
The requirement was to generate unique and valid file names for Microsoft Excel files. The name should contain the data title and date/time when the data was exported. Here is the code I used for creating the file names for Excel documents: function fileNameCreate(title: string): string { // Remove invalid characters, replace spaces with underscore… Continue reading Function to create a file name for exported Excel document
Button for exporting data as Excel document in React JS
Recently, I had to implement a custom button for exporting data shown in a React JS app grid in Microsoft Excel format. The data is received from the NetSuite side using an API call and it is in ‘array of objects’ format. There are multiple libraries that help to create Excel files. But, I used… Continue reading Button for exporting data as Excel document in React JS
How to use a mapping object to replace values in a data array of objects
The requirement was to show abbreviated values for the shipping item label values sourced from the NetSuite side in a React JS web application. For this, I created a map object and stored the original names and abbreviations as key-value pairs. Used a map function to replace the values in the data object before rendering.… Continue reading How to use a mapping object to replace values in a data array of objects
How to fetch saved search data with the title
Recently, I worked on a single-page application(SPA) for rendering saved search data from NetSuite. The client wanted to reuse the application for multiple saved searches. So, the app was designed with a search internal ID as a URL parameter and the data was fetched using the ID. However, the client also wanted to show the… Continue reading How to fetch saved search data with the title
HTTPS GET vs POST for a Portal to NetSuite data sync API
The choice between using HTTPS GET or POST for a data sync API between NetSuite and portal storage depends on the specific requirements and use case of the application. GET requests should be used for retrieving data from the server(NetSuite records), and they can be cached and bookmarked. However, they have limitations on the amount… Continue reading HTTPS GET vs POST for a Portal to NetSuite data sync API
Change date format in a NetSuite saved search result column
In NetSuite, the TO_CHAR() function can be used to convert a date object into a text representation of it. Here are some examples of date/time format values that can be used with TO_CHAR(): ‘YYYY’: 4-digit year‘IY’ or ‘IYYY’: ISO Year‘M’: Month2‘DL’: Long version of the date including day of the week, month, day, and year‘YEAR’:… Continue reading Change date format in a NetSuite saved search result column
Precautions when sending emails to multiple users from NetSuite through SuiteScript
When sending an email to multiple users from NetSuite through SuiteScript, there are several precautions and best practices to keep in mind: Limit on Recipients: NetSuite allows a maximum of 10 recipients (including recipient, cc, and bcc) for each email. If you need to send an email to more than 10 recipients, you may need… Continue reading Precautions when sending emails to multiple users from NetSuite through SuiteScript