Custom Module Tutorial

A custom module script contains logic that you can use in other scripts. If you reuse logic in several scripts, store it in a custom module instead of copying it. This approach makes shared logic easier to maintain.

This tutorial shows how to create a custom module script, upload it to NetSuite, and update a user event script to use the module.

Complete the tutorial in the following order:

  1. Review the Sample Script Overview.

  2. Deploy the Prerequisite Script.

  3. Creating and Reviewing the Custom Module Script.

  4. Referencing the Custom Module in the User Event Script.

  5. Uploading and Testing the Revised User Event Script.

Start with the overview and prerequisite script, then continue through the linked tutorial topics in order.

Sample Script Overview

The custom module script in this tutorial automatically creates a phone call record. After you create this module and upload it to your NetSuite File Cabinet, you can call it from an entry point script.

When you've finished updating the entry point script (as described in this tutorial), the custom module runs each time a new employee record is created. If the new employee record has values for Phone and Supervisor, the module schedules a call between the supervisor and the new employee.

Deploy the Prerequisite Script

If you have not deployed the user event script described in SuiteScript 2.1 User Event Script Tutorial, deploy it now.

Related Topics

General Notices