Purpose: Inventory counts are used to physically verify and count the items in inventory to ensure that the system records match the actual inventory levels. This process helps identify discrepancies between recorded and actual inventory. Process: Cycle Counts: These are periodic counts of a subset of inventory, often done on a rotating schedule. Physical Inventory… Continue reading Inventory Count CSV Import
Author: Linu Paul
How to parse the excel file into JSON structure
/** * @description | To process and create custom records based on csv file * @param {*} scriptContext */ function processAndUploadExcelFile(scriptContext) { try { const… Continue reading How to parse the excel file into JSON structure
When we created the search in the UI, we obtained results. However, when exporting the same search into a script, the date becomes unreadable and the search results are empty.
The issue arises because the date is not in the company preferences format. Therefore, we need to convert the date to match the company preferences format before passing it to the search. const getInputData = (inputContext) => { try { let… Continue reading When we created the search in the UI, we obtained results. However, when exporting the same search into a script, the date becomes unreadable and the search results are empty.
How to change the date format into user preferences format using moment.js
let userDateFormat = runtime.getCurrentUser().getPreference({ name: ‘DATEFORMAT’ }); //dateFormat : format read from CSV file … Continue reading How to change the date format into user preferences format using moment.js
Use of Cache module
On the Suitelet page, we can use the cache module to display messages without passing parameters. define([‘N/cache’, ‘N/ui/serverWidget’, ‘N/redirect’, ‘N/ui/message’, ‘xlsx’,’N/task’], (cache, serverWidget, redirect, message, XLSX,task) => { “use strict” let scriptId = ‘customscript_jj_sl_file_storing_mhaun_35’ let deployId = ‘customdeploy_jj_sl_file_storing_deploy’ … Continue reading Use of Cache module
How to Display messages based on parameters
/** * @description| to create message on Suitelet page * @param {*} statusValue * @param {*} form */ function displayMessageBasedOnParam(statusValue, form) { try { … Continue reading How to Display messages based on parameters
How to create a payment record in NetSuite
/** * @description To create paymentRecord * @param {string| number} collector * @param {string| number} salesRep * @param {string} receiptNumber * @param {object} paymentDetails * @param {object} invoiceData … Continue reading How to create a payment record in NetSuite
TypeError: newRec.getSublistSubrecord is not a function
“TypeError: newRec.getSublistSubrecord is not a function,” indicates that the getSublistSubrecord function is not available on the Record object in the client script context. This function is available in server-side scripts but not in client scripts.
CREATE_OR_MODIFY_SUBRECORD_IN_USER_EVENT_BEFORELOAD_SCRIPT_IS_NOT_SUPPORTED_YET__YOU_CAN_ONLY_VIEW_SUBRECORD_IN_USER_EVENT_BEFORELOAD_SCRIPT
NetSuite follows a standard behavior where creating an inventory details subrecord in the beforeLoad() trigger point of a user event script will result in an error. type: “error.SuiteScriptError”, name: “CREATE_OR_MODIFY_SUBRECORD_IN_USER_EVENT_BEFORELOAD_SCRIPT_IS_NOT_SUPPORTED_YET__YOU_CAN_ONLY_VIEW_SUBRECORD_IN_USER_EVENT_BEFORELOAD_SCRIPT”, message: “Create or modify subrecord in User Event beforeLoad script is not supported yet. You can only view subrecord in User Event beforeLoad script.”, id: “”,… Continue reading CREATE_OR_MODIFY_SUBRECORD_IN_USER_EVENT_BEFORELOAD_SCRIPT_IS_NOT_SUPPORTED_YET__YOU_CAN_ONLY_VIEW_SUBRECORD_IN_USER_EVENT_BEFORELOAD_SCRIPT
How to get the details of next two months
/** * Function to get details of next 2 months * @returns {*[]} */ function getCurrentMonthDetails() { try { const weekdays = [‘Sunday’, ‘Monday’, ‘Tuesday’,… Continue reading How to get the details of next two months