Performance Tips for Scripts and Workflows

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.

A computer script is a series of commands that automate certain processes. Scripts can run behind the scenes in NetSuite to affect how the database handles record processing. 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, scripts categorized as “user event scripts” run on every record processed. Scripts are not affected by the role of the user submitting 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. The processing might include a script that is in place for core NetSuite functions.

Common SCIS POS tasks NetSuite Records used by SCIS
  • 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.

System Time flow chart
Note:

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.

Record Types for Script Deployments

Disable or Exclude unneeded User Event Scripts

NetSuite provides various methods for preventing execution of a user event script. For SCIS, you should use either of the following two:

Disabling a Script Deployment via its Context

The type of processing that executes a script is referred to as the execution context. If a script is not required to complete a processing task within a certain context, then you can often improve performance by disabling that script from running in that context.

For SCIS, the contexts in which a script can be safely disabled are:

  • Payment Postback — Used with SCIS-supported payment devices

  • Web Application — Used for submitting SCIS records

Use the procedure in this task to view and disable scripts that are not required in the selected SCIS processing context.

Note:

Disabling or re-enabling these scripts do not affect your SuiteCommerce or SuiteCommerce Advanced web store setups.

To view and disable scripts by context:

  1. Log into NetSuite as an Administrator.

  2. Go to the desired script deployment context list to review:

    • Payment Postback Scripts — Go to Commerce > InStore > (Performance) Scripts on Webcontext

    • Web Application Scripts — Go to Commerce > InStore > (Performance) Scripts on Webapps

    All scripts in the selected context that are included in your account display in a list. The list includes:

    • Record — The record or record-type that causes the script to execute. Execution occurs when an instance of that record is created or updated in a Payment Postback or Web Application context.

    • Number of Execution Context — The number of contexts under which the script is executed. For example, Script X might run under a Bank Connectivity context, Payment Postback context, and Promotions context, for a total of 4 contexts.

    Script Deployments in WEBAPPLICATION context Number of Execution Context
  3. Click Edit for the script to disable.

    The Script Deployment page opens.

  4. Open the Context Filtering subtab.

    Context Filtering subtab
  5. In the Execution Context list, clear the highlighting on one or both of these contexts:

    • Payment Postback

    • Web Application

    Important:

    Do not clear highlights for other contexts. Some contexts might already be cleared.

    Tip:

    Hold the Ctrl key and click a highlight to clear it.

  6. Click Save.

  7. Repeat these steps as needed to disable other scripts in Payment Postback and Web Application contexts.

Disabling a Script by Clearing its Role Assignment

Disabling a script by clearing its role assignment applies to user event scripts only.

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.

    Script Deployment Subtabs

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.

    Disable Tax Calculation at Line Level Option

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 Avalara Extensive Logging

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.

Related Topics

Performance Management and Tips for SCIS
Application Performance Management (APM) for SCIS
Performance Tips using NetSuite Settings
Performance Tips for using SCIS POS Devices
Performance Tips for Network Resources
Performance Tips for using Third-Party SuiteApps

General Notices