Suitelet script to trigger user event script

Suitelet script is used to trigger user event script. User Event script define([‘N/record’, ‘N/url’, ‘N/https’],     /**  * @param{record} record  */     (record, url, https) => {         /**          * Defines the function definition that is executed before record is loaded.          *… Continue reading Suitelet script to trigger user event script

Fetch value from custom field in advanced pdf template

To fetch value from a custom field created using script in advanced pdf template. <td align=”center” margin=”0px” padding-bottom=”3px” padding-top=”3px” style=”border-color: #a09fa3; border-bottom:thin; border-right:thin;” width=”8%”>     <#if record.custpage_jj_item_data?has_content>         <#assign itemData = record.custpage_jj_item_data?eval>         <#list itemData as itData>             <#if item.item == itData.itemName>  … Continue reading Fetch value from custom field in advanced pdf template

Custom field using script to store manufacturer country from item

Script to create a custom field and store the manufacturer country from item record. define([“N/search”, “N/ui/serverWidget”], (search, serverWidget) => {   /**    * Defines the function definition that is executed before record is loaded.    * @param {Object} scriptContext    * @param {Record} scriptContext.newRecord – New record    * @param {string} scriptContext.type – Trigger… Continue reading Custom field using script to store manufacturer country from item

Create a button and validate the fields on button click

To create a button and on button click validate the fields User Event Script function beforeLoad(context) {         if (context.type === context.UserEventType.VIEW) {             let form = context.form;             let customerRecord = context.newRecord;             let isProjectCreated =… Continue reading Create a button and validate the fields on button click

To display item table in pdf based on date created using advanced pdf/html template

To display item table in pdf based on date created using advanced pdf/html template. The button is available in invoice record. The date considered should be the created date in the related sales order. <#if record.item?has_content>   <#assign cutoffDate = “01/02/2025”?date(“dd/MM/yyyy”)> <#assign createdFromDate = record.createdfrom.trandate> <#if createdFromDate?has_content> <#assign soDate = createdFromDate> <#if soDate < cutoffDate>… Continue reading To display item table in pdf based on date created using advanced pdf/html template

To import a budget

To import a budget: Go to Transactions > Financial > Set Up Budgets > Import. On the Import Assistant page, in the Scan & Upload CSV File section, select the type of character encoding for imported data. After the import of budget data has completed, you can review NetSuite budget records by going to the… Continue reading To import a budget

Adding a subtab below QC tab in Purchase order

To add a ‘QC Requirements’ subtab below QC tab in purchase order. var sublist = form.addSublist({ id: ‘custpage_sublist’, type: serverWidget.SublistType.LIST, label: ‘QC Requirements’, tab: ‘custom1660’ }); sublist.addField({ id: ‘customfield1’, type: serverWidget.FieldType.TEXT, label: ‘Line #’ }); sublist.addField({ id: ‘customfield2’, type: serverWidget.FieldType.TEXT, label: ‘Item’ }); sublist.addField({ id: ‘customfield3’, type: serverWidget.FieldType.TEXT, label: ‘QC Questions’ }); sublist.addField({ id: ‘customfield4’,… Continue reading Adding a subtab below QC tab in Purchase order

Using IN operator along with formula text in search filter

When “anyof” operator is not available in search criteria then IN operator can be used as following: let lineUniqKey = [“48662″,”48663″,”48664″,”48665”]; let uniqKeyIfMapping = {}; // Object to store the mapping of lineUniqKey to IF number let inClauseValues = lineUniqKey.map(value => `’${value}’`).join(“,”); // Convert array to IN clause string let filters = [ [ [“type”,… Continue reading Using IN operator along with formula text in search filter

Function to handle “Error Parsing XML: The entity name must immediately follow the ‘&’ in the entity reference” error

When following error is obtained: “Error Parsing XML: The entity name must immediately follow the ‘&’ in the entity reference.”, Use the escapeSpecialChar function function escapeSpecialChar(textvalue) {             try {                 textvalue = textvalue.replace(/&/g, ‘&amp;’);                … Continue reading Function to handle “Error Parsing XML: The entity name must immediately follow the ‘&’ in the entity reference” error