How to call the get function of service controller upon page load

If you need to dispaly the results of a netsuite search in a sca webstore page in page load, you need to pass the required data as parameter to that page.

In the router function, call the dervice file. You may call it directly or use the model file in which the service url is defined. Use the model.fetch() method . The .fetch() method calls the get() method in the service controller.

In the get method of the service controller, we can call the required function of the suite script model file in which the search is defined.

The result of the search is then passed back to the router function, which is then passed as parameter to the required view file

eg code:

Leave a comment

Your email address will not be published. Required fields are marked *