Performance Tips for Scripts and Workflows

This topic applies to

Applies to

SuiteCommerce InStore


Use the tips in this section to help ensure scripts and workflows 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.


SCIS does not have a direct method for blocking the execution of unneeded scripts and workflows. However, NetSuite includes methods to accomplish this task. These methods are described in the following topics.

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 or Exclude unneeded User Event Scripts

NetSuite provides two methods for preventing execution of a user event script:

Disabling a script by clearing its Role assignment applies to user event scripts only. Excluding a script from execution via its context applies to most scripts and workflows in SCIS.

To clear a User Event Script’s Role assignment:

  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.

Excluding unneeded Script and Workflow Execution via Context

Use this performance tip to exclude scripts and workflows from processing in contexts where they are not needed. The exclusions reduce the system time required to complete a transaction.

The procedure to set up exclusions uses a NetSuite method for Analytics filtering using the context in which a script or workflow executes. You can set exclusions for user event scripts, client scripts, and workflows.

The contexts available for SCIS exclusion are:

  • Web Application — Used for submitting SCIS records

  • Payment PostBack — Used with SCIS-supported payment devices

The first set of steps use Analytics filtering to identify unneeded scripts and workflows by context. Then you can use the context list found on the Script Deployment or Workflow page to exclude them from those contexts. The procedures follow this path:

  • A. Use the Analytics tools to identify scripts and workflows that include a context.

  • B. Use the Script Deployment page to set exclusions for those scripts.

  • C. Use the Workflow page to set exclusions for those workflows.

A. Use Analytics to identify scripts and workflows by context:

You should repeat these steps for each type of script or workflow implemented in your account.

  1. Log into NetSuite as an administrator.

  2. Go to Analytics.

  3. If you have performed these steps before and saved a workbook, search for and open that workbook.

  4. Otherwise:

    a. Click New Workbook and search by entering the type of script or workflow:

    • User Event Script Deployment

    • Client Script Deployment

    • Workflow Action Script Deployment

    b. Click on that script or workflow deployment to open the filter page. The following examples are based on the user event script deployment.

  5. Search for the Execution Context criteria and drag it to a new column.

  6. Search for and drag ID to a new column. The ID will list the script name.

  7. Open the Execution Context column menu and select Filter.

  8. In the Filter form, select the context to exclude and move it to the right.

    Available contexts for SCIS exclusion are:

    • Web Application

    • Payment PostBack

  9. Click OK.

    The results refresh to show only those scripts or workflows that include the filter you selected.

  10. If desired, click the Save icon to save the workbook with your criteria choices.

  11. Note the script or workflow identifiers in the ID column. You will use the IDs to set context exclusions.

  12. Use the next sets of steps to set exclusions for each script or workflow context identified.


You can open the Script Deployments and Workflow pages in new browser tabs.

B. Set exclusions for identified scripts:

  1. Go to Customization > Scripting > Script Deployments.

  2. Review the ID column for a script identified in the previous task.

  3. Click Edit for that script.

  4. On the Script Deployment page, click the Context Filtering subtab.

  5. Find the desired context in the Execution Context list.

    By default, NetSuite highlights all contexts. A highlighted context means that the script will run (execute) for that context.

  6. Press and hold the Ctrl key, then deselect the context. For example, deselect Web Application.

    Leave the other contexts highlighted or clear.

  7. Click Save.

C. Set exclusions for identified workflows:

  1. Go to Customization > Workflow > Workflows.

  2. Review the ID column for a workflow identified in the previous task.

  3. Click Edit for that workflow.

  4. In the Workflow context panel on the right, click the Edit icon.

  5. Scroll to the Contexts list.

  6. Press and hold the Ctrl key, then deselect the context. For example, deselect Web Application.

    Leave the other contexts highlighted or clear.

  7. Click Save.

Repeat the Analytics and Exclusion steps as needed

Repeat using the proceeding steps until all desired scripts and workflows are excluded for the appropriate contexts.

Convert or Refine the Scripts You Need

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. Actions that can initiate tax recalculations during a transaction 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

This topic lists a few setups you can do to boost SCIS performance when using Alvalara AvaTax.

Disable Avalara Tax Calculation at the Line Level

This performance feature controls when Avalara AvaTax calculates taxes for SCIS. Rather than running calculations each time a sales associate adds an item to the cart, the feature puts tax calculations on hold until all cart entries are complete.

Delaying tax calculations until the transaction is ready for payment allows SCIS to focus resources on item entry and other cart options. It can reduce the time spent waiting for tax calculations to complete.

To disable Avalara line-level tax calculations:

  1. Log into NetSuite.

  2. Go to Avalara > Set up > Configure Avalara.

  3. Click the Tax Calculation subtab.

  4. Check the option to Disable Tax Calculation at Line Level.

  5. Click Save.

The setup to disable Avalara AvaTax calculations at the line level is complete.

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 Role or by excluding a script via its execution context.

  • AVA_CustomerBeforeLoad

  • AVA_CustomerBeforeLoad_Address

  • AVA_CustomerBeforeLoad_Certs

See Disable or Exclude unneeded User Event Scripts for the steps.