Author Archives: smiling coders

SOME IMPORTANT FACTS ABOUT CLIENT SCRIPT

In this netsuite training and netsuite customization tutorial we show:
WHAT IS A CLIENT SCRIPT?Client scripts are SuiteScripts executed in the browser. Client script is used for validating values entered by user, populating values in fields, executing logic on click of custom button. Client script can be deployed on records or it can also be attached on forms. It can be also attached on a user event script or suitelet script.


WHAT ARE THE

Read the rest

HOW TO PREVENT ERRORS WHEN DELETING SUBLIST ROWS USING SCRIPT IN NETSUITE? -NETSUITE ACADEMY

AS a netsuite solution provider While trying to delete any sublist row, the row with the highest line number must be deleted first. For eg: if there are 5 lines with line number 1,2,3,4 and 5. Suppose you want to delete 3rd and 5th line item.If you are doing netsuite customization and want to delete the 3rd row first using nlapiRemoveLineItem(‘item, 3), then there are only 4 lines remaining and using nlapiRemoveLineItem(‘item, 5) will throw
Read the rest

HOW TO RETURN A VALUE FROM A BACKEND SUITELET TO CLIENT SCRIPT?

IN Netsuite Customization Client script executes in the logged in user’s role. This can create errors while trying to access records for which logged in user doesn’t have required permission. The solution is to call a backend suitelet from the client script.As a NetSuite Solution provider  we suggest  If you need to use that value in client script for setting values or giving alert, then you can return the value from suitelet back to
Read the rest

HOW TO OVERCOME GOVERNANCE LIMIT IN SCHEDULE SCRIPT?

As a netsuite solution provider wewant to tell you Schedule script has a governance limit of 10000 units. In many situations, schedule script is used for processing huge amount of data and this might take more than 10000 units. To overcome this problem, Netsuite provides the api’s nlapiSetRecoveryPoint() and nlapiYieldScript(). This creates a recovery point and re-executes the schedule script from where it left and its governance units are also reset. It can create
Read the rest

HOW TO INCLUDE HTML AND CSS IN SUITELET SCRIPT?

As a NetSuite Solution Provider this thime we will tell you about Suitelets.Suitelets are of two types- Front end and Back end. Front end suitelet is used for creating forms, assistants etc. Sometimes netsuite solution provider can’t create the UI by using only Netsuite API’s. We might have to use html and css to build the page. The following ocde shows how it can be done:var html = ‘<!DOCTYPE html>n’
+'<html>n’
+'<head>n’
+'<link href=”https://system.netsuite.com/core/media/media.nl?id=1234&_xt=.css” rel=”stylesheet”
Read the rest

USING NETSUITE API nlapiSetCurrentLineItemMatrixValue

There are many api’s in Netsuite which are not frequently used in customization’s but has lot of importance.

Feel free to reach your NetSuite Solution Provider , TheSmilingCoders for proper netsuite implementationnetsuite consultation , netsuite customizationnetsuite Support,netsuite Training, nlapiSetCurrentLineItemMatrixValue can be used to set the price of an item in the item record. This cannot be achieved by using the api nlapiSetLineItemValue.

The following code can used with or

Read the rest

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

Read the rest

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 =

Read the rest

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)

Read the rest

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.

Read the rest