Bundle SuiteScript Deployment Guidelines

When installing a bundle, or deploying a script included in one of the NetSuite bundle for the integration, you should ensure that:

Verifying Integration Script Deployment Settings

Deployed integration scripts must be deployed for all roles and, in the case of portlet, Suitelet, or user event scripts, executed as the NSOA Connector or the custom role you created for the integration.

You should use the following steps when deploying a script included in one of the NetSuite bundles for the integration, or when troubleshooting NetSuite records not being imported into OpenAir, for example.

To verify integration script deployment settings:

  1. Go to the script deployment record for a script and record type. To do so:

    1. Go to Customization > Scripting > Script Deployments.

    2. Use the filters to show only the relevant script deployments for a Script, a Record type, or both.

    Tip:

    If you are looking for script deployments for a script in a specific bundle, go to Customization > Scripting > Scripts, use filters to show only the scripts in the bundle (From bundle), and view the script. The script deployments for the script are listed in the Deployments subtab.

  2. Click Edit.

  3. Change the following settings:

    • Deployed – Check the box

    • Execute as Role – (Portlet, Suitelet and User event scripts) Select NSOA Connector or the custom role you created for the integration. See Creating a Custom Role for the Integration in NetSuite.

    • Roles (Audience subtab) – Check the Select All box.

  4. Click Save.

Verifying User Event Scripts Running Order

If you are using real-time record imports from NetSuite into OpenAir, the user event script sending the record to OpenAir (OpenAir: Send Record to OpenAir or OpenAir: Send Record to OpenAir 2.0) should run after all other user event scripts for that record type.

Important:

The running order of user event scripts may change when you update a bundle in NetSuite. You should verify and, if necessary, change the script running order for all relevant scripted records in NetSuite. The afterSubmit user event script sending the record to OpenAir (OpenAir: Send Record to OpenAir or OpenAir: Send Record to OpenAir 2.0) should run after all other user event scripts for the record type.

If the user event script for the real-time integration is not the last to run, the real-time integration may create duplicate records in some cases. The OpenAir: Send Record to OpenAir or OpenAir: Send Record to OpenAir 2.0 triggers the real-time integration process. If an afterSubmit script runs afterward and modifies the record in NetSuite, this causes the real-time integration process to be triggered again before the previous process finishes, resulting in the creation of duplicate records.

Effective with the OpenAir 2021.2 release, additional validation and a temporary record lock prevent the creation of duplicate records in OpenAir when importing a record from NetSuite to OpenAir using the real-time integration. OpenAir NetSuite Connector now checks for any processes already importing the record and locks the record until the import process completes so the same record cannot be imported by more than one process at the same time. This removes the script running order requirement and prevents the creation of duplicate records in OpenAir. However, it is best practice to verify that the OpenAir user event script for real-time integration is the last in the script running order.

For more information about changing the running order of user event scripts, see The Scripted Records Page (external link to NetSuite SuiteAnswers | Answer ID: 10555.

To verify the running order of user event scripts for a record type:

  1. Go to Customization > Scripting > Scripted Records > [Select a scripted record type].

  2. Click Edit.

  3. In the User Event Scripts subtab, move OpenAir: Send Record to OpenAir 2.0 to the bottom of the sublist.

  4. Click Save.