We can apply a credit memo on a specified invoice through Suitescript: 1.0 // …existing code… //Load Credit Memo var creditMemoRecord = nlapiLoadRecord(‘creditmemo’, creditMemoID); //Get line number with invoice where you want apply var invoiceLineIndex = creditMemoRecord.findLineItemValue(‘apply’, ‘internalid’, InvoiceIdToApplyMemo); if (invoiceLineIndex !== -1) { //Get Total amount of invoice var invoiceTotal… Continue reading How to apply a credit memo on an invoice through Suitescript
Category: NS Customization
All articles / code related to Netsuite customization
Understanding Advanced PDF Printing Errors with Rich Text Fields in NetSuite
When printing transactions in NetSuite using Advanced PDF/HTML Templates, user may encounter errors if the template includes a Rich Text custom field. The printing failed with the following error: Error Message: The template cannot be printed due to the following errors: Error on line 203, column 504 in template. Detail: The value of attribute “style”… Continue reading Understanding Advanced PDF Printing Errors with Rich Text Fields in NetSuite
Use case of unchecking the Store Value checkbox during the custom field creation
What is the Store Value checkbox? By default, the Store Value option is enabled so that custom field values are stored in your NetSuite account. If you don’t want any changes entered stored in the custom field, clear the Store Value box. Not storing the value enables you to look at data that’s stored elsewhere. If you don’t store… Continue reading Use case of unchecking the Store Value checkbox during the custom field creation
Importance of the defaultValue in the record.create
When you create records of certain types, you can use the defaultValues parameter to provide default values for fields in the new record. For some record types, some default values are required. For example, when you create a script deployment record, you must provide the internal ID of an existing script in your account (to associate with… Continue reading Importance of the defaultValue in the record.create
How to lock the record only in the user interface through workflow?
We can use a workflow to lock a record. By default, this lock applies in all contexts except “Web Application” and “Web Store,” meaning no updates can be made through scripts, REST, or SOAP services. If the intention is to restrict only users making direct updates in the record, then in the workflow’s context settings,… Continue reading How to lock the record only in the user interface through workflow?
How to global search records using custom field?
When creating a custom field for a record, there’s an option to include it in the global search. Enabling this allows the record to be found in global search results using the value entered in that custom field.
Formatting Today’s Date in dd/mm/yyyy Format
To generate today’s date in add/mm/yyyy format that reflects local time, not UTC, within a SuiteScript environment. let today = new Date(); let localDate = new Date(today.getTime() + (today.getTimezoneOffset() * 60000)); let dd = (‘0’ + localDate.getDate()).slice(-2); let mm = (‘0’ + (localDate.getMonth() + 1)).slice(-2); let yyyy = localDate.getFullYear(); let formattedDate = dd + ‘/’… Continue reading Formatting Today’s Date in dd/mm/yyyy Format
Estimating Completion Date While Ignoring Holidays and Weekends
Overview This article outlines how to calculate an estimated completion date for a task or order in NetSuite, excluding weekends and holidays. Holidays are loaded from a CSV file stored in the File Cabinet, and the logic accounts for both hourly and daily turnaround times. Components 1. Holiday CSV File Format: The CSV should have… Continue reading Estimating Completion Date While Ignoring Holidays and Weekends
Use of Online Customer Form in NetSuite
Scenario The Online Customer Form in NetSuite captures lead, customer, or contact data from a website, integrating with CRM and ERP modules to automate data entry. Solution The form collects website visitor data, creating or updating Leads, Customers, or Contacts. Enable via Setup > Company > Enable Features > CRM > Online Forms and embed… Continue reading Use of Online Customer Form in NetSuite
Difference between createpo and createdpo on Advanced PDF/HTML Template of Picking Ticket
When editing an Advanced PDF/HTML Template for a Picking Ticket in NetSuite, users may encounter two fields under the Item sublist of the Sales Order: createpo and createdpo. These fields, listed in the SuiteScript Records Browser for Sales Order, appear similar in syntax but serve distinct purposes. This article clarifies the differences between these two… Continue reading Difference between createpo and createdpo on Advanced PDF/HTML Template of Picking Ticket