Use N/runtime Module in Netsuite for User Details

Netsuite N/runtime module provides methods to get the user inside the script, these are very useful if you want to set the current logged-in user into any field on record or if you want to use the email id of the current user, etc. ** Please Note: If the user event script or suitelet script is triggered… Continue reading Use N/runtime Module in Netsuite for User Details

Multiply divide or use the Arithmetic field’s values in Advanced PDF

Advanced PDFs are a very useful feature of Netsuite, using Advanced PDF you can write most logic but it is time-consuming, especially if you are stuck in any field-related error. Netsuite provides a good amount of error message if you are using Advanced PDF UI but it is not too useful if you try to… Continue reading Multiply divide or use the Arithmetic field’s values in Advanced PDF

Set the Date field in Suite Script

In Suite Script 2.0, setting date is not as simple as setFieldValue() To fix this issue,Step 1: The developer should use the “N/format” module,Step 2:  format.format() method             format.format({value: DateVariableHere, type: format.Type.DATE}),Step 3:  set this value using  setValue() //============== Use the below code for the date to date field ================ Use the parse method to parse… Continue reading Set the Date field in Suite Script

Proposal for Auto PO creation from Item Record

Proposal Summary This proposal covers the scope of Auto PO creation from Item Record and automatically populates the sublist of the Purchase Order with the corresponding Item as a line item. Requirement The objective is to introduce a button within the Item Record. When this button is clicked by users, it is designed to direct… Continue reading Proposal for Auto PO creation from Item Record

LOADING CUSTOM HTML AND BOOTSTRAP WITHIN A SUITELET FORM

This example is to enable the use of custom HTML inside a Netsuite form. It is feasible to modify the example to send POST requests to the suitelet and load additional jQuery plugins and scripts. With this example, it is possible to generate buttons, labels, tables, badges, navbars, alerts, and list groups, each with distinct… Continue reading LOADING CUSTOM HTML AND BOOTSTRAP WITHIN A SUITELET FORM

RUNNING CLIENT SCRIPT IN VIEW MODE

In order to run clientscript in view mode you need to modify the form on BeforeLoad using a UserEvent script and attach a Clientscript file to the form using the clientScriptFieldId function. Suitescript 2.0 InlineHTML Hack: If you need to run your code without having to click a button you can try the the following code. This… Continue reading RUNNING CLIENT SCRIPT IN VIEW MODE

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