Short Name of the Customer Using User Event Script

Using the below logic we are able to create shortname of the customer in the following format First 2 characters of the customer’s name: date created month (01)  /**  * @NApiVersion 2.1  * @NScriptType UserEventScript  */ define([‘N/record’, ‘N/search’],     /**  * @param{record} record  * @param{search} search  */     (record, search) => {  … Continue reading Short Name of the Customer Using User Event Script

Mastering SuiteScript: Essential JavaScript Tips and Tricks for Developers

Mastering Suite Script often requires going beyond the basics and leveraging advanced JavaScript techniques to create efficient, maintainable, and robust scripts. In this article, we’ll explore some essential JavaScript tips and tricks that can elevate your SuiteScript development. 1. Use Let and Const Instead of Var In modern JavaScript (ES6 and later), it’s recommended to… Continue reading Mastering SuiteScript: Essential JavaScript Tips and Tricks for Developers

List of Items having Quantity in transit using Search Module

  let itemobj = search.create({                     type: search.Type.ITEM,                     filters:[‘internalid’,‘is’,itemid],                     columns:[‘internalid’,‘quantityintransit’]                 });              … Continue reading List of Items having Quantity in transit using Search Module

Spread Operator in JavaScript

The spread operator in JavaScript, represented by …, allows an iterable (such as an array or string) to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals)… Continue reading Spread Operator in JavaScript

How the let, const, and var Keywords Work in JavaScript

In JavaScript, we can declare variables in three different ways like this: It is best when you understand var, let, and const with these three concepts: Scope Reassigning a new value When you access a variable before declaring it These keywords differ in usage with respect to these concepts. Variable Scope in JavaScript In JavaScript,… Continue reading How the let, const, and var Keywords Work in JavaScript

Serverside promises

Promises are now supported serverside so you can now write asynchronous code. Example You can also create your own Promises now like so: Async functions (Async/Await) Async functions provide a way to structure and simplify your asynchronous code. It is useful to avoid callback that comes with Promises as it can get pretty complex. Example