NetSuite Expert
+1-209-266-2427 info@netsuiteexpert.in
+1-209-266-2427
info@netsuiteexpert.in

Suitescript 2.0 APIs

SuiteScript 2.0 is the recommended API version for new SuiteScript development. SuiteScript 2.0, the APIs have been categorized and separated into modules. Modules have replaced unstructured files.

We will update the modules regularly, however you can find some of them below as:

scriptContext. newRecord

User Script
/**
*@NApiVersion 2.x
*@NScriptType UserEventScript
*/
define(['N/record'],
	function(record) {
		function function_call(context) {
			var order_record = context.newRecord; 
         		var order_id=order_record.id
         	}

   		return {
           		afterSubmit: function_call
         	};
       }
);
Client Script
/**
 * @NApiVersion 2.x
 * @NScriptType ClientScript
 */
define(['N/search'],
    function(search) {
        function function_call(context) {
              var order_record = context.currentRecord;
              var order_id=order_record.id;
        }
  
        return {
            fieldChanged: function_call
        }
});

define Function

Use the define() function to load SuiteScript 2.0 modules and create custom modules. By using the define() function, it loads all dependencies before it executes any logic.


/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 */
define(['N/record'],


1 2