Callback function parameters explained in netsuite

Callback function parameters explained in netsuite

Hi in this tutorial of netsuite solution provider we are going to show you how NetSuite executes the require() Function, it executes the callback function and loads the dependencies when they are required. the define() and require() functions used by SuiteScript 2.0 to load and define modules. This article will help in netsuite implementation.

In simple layman language I will try to differentiate  between the parameter usage of callback function.

require([‘N/record’,’N/search’],function(rec, sea){

            var recobj = record.load({

type: record.Type.INVOICE,

            id: 172932

        });

});

This code will return and reference error : record is not defined as the callback function parameter of function object is different we are using record to call but actually we are using rec as a parameter.

In the below snippet the rec and sea are the function parameters which are used to call the load api of suitesctipt 2.0

require([‘N/record’,’N/search’],function(rec, sea){

            var recobj = rec.load({

type: rec.Type.INVOICE,

            id: 172932

        });

});

Now in the new code you can see all the name is as per the callback function which is rec so no error will be received

You can watch the video for working solution and if you are new to the debugger you can click here to watch the netsuite debugger video. If you like the tutorial follow us and click on the link for more info netsuite solution provider.

Feel free to reach out Netsuite Solution provider  TheSmilingCoders for proper netsuite implementationnetsuite consultation , netsuite customizationnetsuite Supportnetsuite Training NetSuite Celigo Integration , Celigo ConsultantCeligo Integration Consultant.

contact us : [email protected]

Facebook : https://www.facebook.com/Smiling-Coders-Netsuite-Training-Implementation-and-Support-1591053827660082/

Linkedin : https://www.linkedin.com/company/netsuite-academy/


Log out of this account

Leave a Reply