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
Month: December 2023
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
Calculate total from an array of object contains similar items.
Function to find the total from an array of object if it contains similar items. var groupedByItem = arr.reduce(function (result, current) { var item = current.Item; if (!result[item]) { result[item] = { Type: current.Type, Item: item, TotalQuantity: 0 }; } result[item].TotalQuantity += parseInt(current.Quantity); return result;… Continue reading Calculate total from an array of object contains similar items.
Proposal for Auto Applying Discount on Drop Ship PO Items
Proposal Summary This proposal is to display a popup when a Drop Ship Purchase Order is edited. Upon clicking the button within the popup, the system should automatically apply the discount to the Purchase Order. Requirement To apply the discount on the line item of Drop Ship PO. A popup needs to display and… Continue reading Proposal for Auto Applying Discount on Drop Ship PO Items
Weekly Timesheet in the Employee Center in NetSuite
In NetSuite, within the Employee Center, viewing, creating, and maintaining job-related information is possible. Tasks and events can be created, and both purchase requests and expense reports can be submitted, with the ability to monitor the approval status of each. If time tracking is utilized, time can be entered on a daily or weekly basis.… Continue reading Weekly Timesheet in the Employee Center in NetSuite
Fetch current URL Parameters at Before Load user event in SuiteScript 2.0
The beforeLoad’s entry point gives you an http.ServerRequest via the context.request parameter. function beforeLoad(context) { var parms = context.request.parameters; if(parms) { // do stuff } }
Employee Center Dashboard in NetSuite
In NetSuite, within the Employee Center, viewing, creating, and maintaining job-related information is possible. Tasks and events can be created, and both purchase requests and expense reports can be submitted, with the ability to monitor the approval status of each. If time tracking is utilized, time can be entered on a daily or weekly basis.… Continue reading Employee Center Dashboard in NetSuite
Create projects from sales transactions
Project records can be created from sales transaction – Projects can be created from sales order , opportunities, estimate which are not closed, pending approval and cancelled To enable this feature – in the item record for the service item for sales and resale – click on the checkbox create project under the related records… Continue reading Create projects from sales transactions