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

Suitescript 2.0 APIs

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