Posts

USER EVENT SCRIPT 2.0 TO LOAD A RECORD, READ IT'S VALUE AND SET A FIELD VALUE

Below code loads a sales order, reads it's sublist values and sets value of a custom field. /**  *@NApiVersion 2.x  *@NScriptType UserEventScript  */ define(['N/record','N/log'], // modules used     function(record,log) {             function afterSubmit(context) {             if (context.type !== context.UserEventType.DELETE)             {                                  var rec_id = context.newRecord.id; // get record id                                          log.debug({                       title: 'rec_id',                       details: rec_id                       });                                          var load_so =  record.load({                         type: record.Type.SALES_ORDER,                         id: rec_id,                         isDynamic: false,                     });                                          var line_count = load_so.getLineCount({                         sub

HOW TO CREATE A FULL CALENDAR IN NETSUITE USING SUITELET?

A full calendar can be built in netsuite using suitelet script. This would require you to first download the zip file from https://fullcalendar.io/download. Place this file at file cabinet and note down the url of fullcalendar.min.css, fullcalendar.print.min.css, /lib/moment.min.js, /lib/jquery.min.js, fullcalendar.min.js. You can also create a client script and refer that url in html link ref, so that it can be triggered when user selects a date. Below is the sample code: replcae the link url with your url  var html = '<!DOCTYPE html>\n' +'<html>\n' +'<head>\n' +'<meta charset="utf-8" />\n' +'<link href="https://system.netsuite.com/core/media/media.nl?id=1234&c=4318&h=7264c1d&_xt=.css" rel="stylesheet" />\n' //fullcalendar.min.css +'<link href="https://system.netsuite.com/core/media/media.nl?id=4523&c=4318&h=695a0109b&

HOW TO CREATE SUITELET ASSISTANT IN NETSUITE?

Creating a suitelet assistant involves the following steps: 1)  Create the assistant. 2)  Create steps. 3) Attach client script to validate data on page init, field change, save ( when user clicks on next or finish) or any other trigger function supported by client script. 4)  Build pages for each step. (Get Function) 5) Set values for fields 6) Set up the action when user clicks on next, cancel, back or finish. (Post function) 1) Create the assistant First step is to create assistant by using the api. You can provide name of the assistant under the api parameter. var assist = nlapiCreateAssistant('SUITELET ASSISTANT); 2)  Create steps. Second step is to assign steps to the assistant. You must provide internal id and the name of the step. You can also declare if each step should be completed before proceeding to next one or can be completed randomly.        var step1 = assist.addStep('customstep_step1', 'STEP1'); var step2 = assist.a

PROCURE TO PAY FLOW IN NETSUITE- NETSUITE ACADEMY

Procure to Pay involves the following steps in Netsuite 1) Create Purchase Order. 2) Approve Purchase order. 3) Create Item Receipt. 4) Create Vendor bill. 5) Create Vendor Payment.

ORDER TO CASH FLOW IN NETSUITE - NETSUITE ACADEMY

Order to Cash flow in Netsuite involves the following: 1) Create Sales Order 2) Approve Sales Order 3) Create Fulfilment record for the sales order. This involves pick, pack and ship 4) Create Invoice 5) Create Customer Payment record.

WHY CLIENT SCRIPT DOESN'T EXECUTE SOMETIMES IN NETSUITE? - NETSUITE ACADEMY

Client script sometimes executes using old code and not the updated code. To resolve this, cache needs to be cleared. Cache can be cleared Once cache is cleared from the browser, you can login to the account again and execute the code. Now, the latest version of the code will get executed. -Netsuite Academy

USING CASE (IF AND ELSE) IN NETSUITE SAVED SEARCH- NETSUITE ACADEMY

While creating a saved search in Netsuite, you want encounter a situation where you want have to display a value depending on some conditions. Such scenarios can be implemented by using sql CASE syntax in the formula field. For eg, in a transaction search, if you want to display a value depending on the transaction type, then you can add a formula text field in coulmn and use CASE as given below: CASE WHEN {type}='Invoice' THEN '0' WHEN {type}='Journal' THEN {status}  ELSE '' END The above field will display 0 when type is Invoice. It will display status of the transaction when type is Journal and for other transaction type, it will be blank. NETSUITE ACADEMY