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.

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.

Disable unneeded User Event Scripts via Roles

You can prevent an unneeded user event script from running by clearing its Role assignments.

Note

This tip is for disabling user event scripts only. For client scripts and workflows, see Exclude unneeded Script and Workflow Execution via Context.


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.

Exclude 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.

Tip

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 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 User Event Scripts via Roles for the steps.