Updating the User Event Script

This procedure tells you how to update createTask.js so that it uses the phoneCall.js custom module file. For more information about how dependencies should be defined in the following procedure, see Custom Module Dependency Paths.

To update the script:

  1. Open the createTask.js file for editing.

  2. Add /phoneCall.js to the first argument of the define function to update your dependencies.

    Custom module define statement updated with ./phoneCall added as the third parameter to the first argument.
  3. Add another dependency to the callback function's first argument. This object represents the phone call module. You can use it to access the phone call module's API.

    Custom module define statement updated with phone added as the third argument to the function.
  4. In the script's afterSubmit function, add logic to get the employee's phone number.

    Sample custom module afterSubmit function.
  5. Create a block of code that does the following:

    • Add a conditional test to check if the employee record has values for both the phone number and supervisor fields (Callout 1).

    • Create an object called phoneData that sets all the fields needed for the phone call module's schedule method (Callout 2).

    • Call the schedule method, passing the phoneCall object as its argument (Callout 3).

    Custom module script setting phone data to be sent to the schedule method.
  6. Upload the revised script file to your NetSuite File Cabinet, overwriting the prior version.

Related Topics

General Notices