Performance Tips for User Event Scripts

Use the tips in this section to help ensure user event scripts included in your NetSuite environment do not slow your SuiteCommerce InStore (SCIS) performance.

Scripts can run behind the scenes in NetSuite to affect how the database handles records. If a script is active in NetSuite, it runs each time a user, system or another script creates, modifies, deletes or loads a record in the database. By default, a user event script will run on every record process, regardless of the Role of assigned to the user that submits the transaction.

The SCIS application submits and loads records to the NetSuite database when performing common point of sale (POS) tasks. For example, when a sales associate completes a sales transaction, SCIS submits a Cash Sale or Invoice record.

  • Completing a sale

  • Completing a return

  • Creating or updating quotes

  • Creating a new customer

  • Suspending and resuming transactions

  • Scanning or viewing drill-down details of a transaction

  • Preparing fulfillments

  • Cash Sale

  • Invoice

  • Estimate

  • Customer

  • Customer Payment

  • Credit Memo

  • Sales Order

  • Fulfillment request

The time spent to complete record processing is referred to as “system time.” This time includes the duration required to run the associated scripts. Reducing system time is key for maximizing performance.

Find Scripts that affect records used by SCIS

The first step in maximizing script performance is to locate the scripts that run on records used by SCIS. Then you can identify which scripts to continue running and which scripts to avoid running.

To find Scripts that affect SCIS:

  1. Log into NetSuite as an administrator.

  2. Go to Customization > Scripting > Script Deployments.

  3. Expand the Filters.

  4. Select the desired Record Type, such as Invoice or Cash Sale.

    The list refreshes with the filtered results.

Disable unneeded Scripts via Roles

The SCIS application does not have a direct option to stop a script from running. However, you can prevent its execution by clearing its Role assignments.

To disable unneeded Scripts via Roles:

  1. Log into NetSuite as an administrator.

  2. Go to Customization > Scripting > Script Deployments.

  3. Use information from the task Find Scripts that affect records used by SCIS to locate the script Roles to adjust.

  4. Click Edit by the desired script.

  5. Go to the Audience section.

  6. If checked, clear the Roles >Select All box.

  7. To remove individual assignments, click those Roles to clear the highlights.

  8. Click Save.

Convert or Refine needed Scripts

For scripts that are required to meet your business needs, consider converting or refining those scripts.

  • Convert Workflows and Custom Scripts to Scheduled Scripts. Scheduled scripts run on the server without blocking record handling in NetSuite. They should not affect performance at the point of sale. Whenever possible, try to convert workflows and custom scripts to scheduled scripts.

  • Refine Scripts to minimize actions. If you cannot convert a workflow or custom script to a scheduled script, consider streamlining the tasks it executes. The goal is having the workflow or script perform the least possible amounts of record loading, submission and searching. For searches, ensure the criteria is accurate and returns only the minimum data required to accomplish the task. See Ensure Custom Searches are Efficient.

Performance Tips for Avalara® AvaTax Scripts

SCIS can use the Avalara AvaTax application to calculate sales taxes. AvaTax has a performance impact on SCIS when common point of sale (POS) actions cause AvaTax to recalculate taxes during a transaction. Actions that initiate tax recalculations include:

  • Adding or changing a customer

  • Adding lines to a transaction

  • Applying payment

  • Changing item quantities

  • Voiding items

  • Returning items

  • Ordering items

  • Adding promotions

  • Applying discounts

To reduce performance impacts while using Alavara AvaTax, you can:

Disable Avalara Extensive Logging

One option for improving Avalara performance when using SCIS is to disable the Extensive Logging option. You do this task from your Avalara configuration menus.

To disable Avalara Extensive Logging:

  1. Log into NetSuite as an administrator.

  2. Go to Avalara > Setup > Configure Avalara.

  3. Open the General subtab.

  4. Find Miscellaneous Settings.

  5. Clear the Extensive Logging box.

  6. Click Save.

Disable unneeded Avalara Scripts

Some Avalara user event scripts run on records used by SCIS, but are not needed for SCIS to function. You can disable the following scripts by clearing each script’s assigned Roles:

  • AVA_CustomerBeforeLoad

  • AVA_CustomerBeforeLoad_Address

  • AVA_CustomerBeforeLoad_Certs

See Disable unneeded Scripts via Roles for the steps.