Attaching mutliple files to SalesOrder using record.attach

We can attach multiple files to salesorder using record.attach that can be attached in a user event script. // Track the number of attached files             var attachedFileCount = 0;             // Run the search and attach each file found          … Continue reading Attaching mutliple files to SalesOrder using record.attach

Automating Sales Order Closure Based on Project Status

To streamline the process of managing sales orders in relation to project completion, we have developed a User Event Script for NetSuite. This script ensures that whenever a project’s status is updated to “Closed,” the corresponding sales order is automatically closed. By leveraging a custom field (custentity_jj_sales_order_id) on the project record, the script identifies the… Continue reading Automating Sales Order Closure Based on Project Status

Custom button Action for creating a record using user event and Client script

Custom button action for creating a case record using User Event and Client script. /**  * @NApiVersion 2.1  * @NScriptType UserEventScript  */ define([‘N/currentRecord’, ‘N/record’ ],     /**     * @param{currentRecord} currentRecord     * @param{record} record     */     (currentRecord, record,) => {         /**      … Continue reading Custom button Action for creating a record using user event and Client script

Remove Sales Order button from quote using User Event Script

Remove Sales Order button from Quote if each and every item with the quantity is already created for sales order. After creating a sales Order for every item quantity from a quote, no need to show the sales order button in quote. For that created a custom column in item sublist for storing the value… Continue reading Remove Sales Order button from quote using User Event Script

Change the color of the of the workflow buttons in user event script

  let color, buttonId = [];                     color = ‘ #008000’;                                       buttonId.push(‘custpageworkflow770’);                     buttonId.push(‘custpageworkflow771’);          … Continue reading Change the color of the of the workflow buttons in user event script

Send API Notification

The requirement includes sending Pending Donation details to the API portal while changing the status of Pending Donation record to “Converted”. The request body contains the following details. Status, donationId, donationAmount, referenceId, referenceNo, employeeId. Also, the request body that sends to API portal when the status of Pending Donation record is changed to “Cancelled” contains… Continue reading Send API Notification

Resolving Status Change Detection Issues in NetSuite

In NetSuite, a user event script was deployed on a transaction record to change its status based on certain conditions during the save process, using the AfterSubmit entry point with record.submitFields. Another user event script was deployed to compare the old and new status values. If the status changed to “Cancelled,” further actions were required. However,… Continue reading Resolving Status Change Detection Issues in NetSuite

Restrict save by throwing a message if any of the items in the sales order is restricted to the transactions shipping method.

Consider that there is a custom body field in the item record named Restricted Shipping Method (custitem_jj_restrict_shipmeth). To check if there are any items that are restricted to this shipping method, and restrict the save, use the user event below. /**  * @NApiVersion 2.1  * @NScriptType UserEventScript  */ define([‘N/search’],     /**      *… Continue reading Restrict save by throwing a message if any of the items in the sales order is restricted to the transactions shipping method.

Set the item description from related sales order for dropship and special order items

Here we can set the description from sales order in the purchase order. If the Purchase order is created manually by clicking the link, if the user is entered or modified the description, the script will keep that description and do not overwrite sales order description.   let poLineCount = poRecordObj.getLineCount({ sublistId: ‘item’ });    … Continue reading Set the item description from related sales order for dropship and special order items