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:
-
The script is deployed for all roles and, in the case of portlet, Suitelet, or user event scripts, executed as the
SuiteProjects Pro Integration Administrator
or the custom role you created for the integration. See Verifying Integration Script Deployment Settings. -
If you are using real-time record imports from NetSuite into SuiteProjects Pro, the user event script sending the record to SuiteProjects Pro runs after all other user event scripts for that record type. See Verifying User Event Scripts Running Order.
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 SuiteProjects Pro Integration Administrator
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 SuiteProjects Pro, for example.
To verify integration script deployment settings:
-
Go to the script deployment record for a script and record type. To do so:
-
Go to Customization > Scripting > Script Deployments.
-
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.
-
-
Click Edit.
-
Change the following settings:
-
Deployed – Check the box
-
Execute as Role – (Portlet, Suitelet and User event scripts) Select
SuiteProjects Pro Integration Administrator
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.
-
-
Click Save.
Verifying User Event Scripts Running Order
If you are using real-time record imports from NetSuite into SuiteProjects Pro, the user event script sending the record to SuiteProjects Pro (SuiteProjects Pro: Send to SPP
or SuiteProjects Pro: Send to SPP 2.0
) should run after all other user event scripts for that record type.
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 SuiteProjects Pro (SuiteProjects Pro: Send to SPP
or SuiteProjects Pro: Send to SPP 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 SuiteProjects Pro: Send to SPP
or SuiteProjects Pro: Send to SPP 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 SuiteProjects Pro 2021.2 release, additional validation and a temporary record lock prevent the creation of duplicate records in SuiteProjects Pro when importing a record from NetSuite into SuiteProjects Pro using the real-time integration. The NetSuite integration 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 SuiteProjects Pro. However, it is best practice to verify that the SuiteProjects Pro 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:
-
Go to Customization > Scripting > Scripted Records > [Select a scripted record type].
-
Click
Edit
. -
In the User Event Scripts subtab, move
SuiteProjects Pro: Send to SPP 2.0
to the bottom of the sublist. -
Click Save.