Quick Guide for Adding Functionality to OpenAir with Scripting
NetSuite’s OpenAir is a powerful system with an extensive amount of functionality. Still, you may find that the platform is missing something that could increase the integrity of your data, streamline the application’s usage, or alert teams to critical information.
OpenAir recognized that allowing customizations would help its user base get even more out of their PSA platform. To answer this need, in 2014, NetSuite added the Scripting Center, allowing businesses to extend the functionality of one of their key management systems.
What types of scripts can be built in OpenAir?
There are two general types of scripts that you can create in OpenAir – form scripts and scheduled scripts.
With form scripts, you can trigger an action when a form is submitted, saved, or approved. Form scripts are primarily used for data input validation. Some limited data manipulation can occur, but generally speaking, a form script may not be the ideal place for manipulations, as it can significantly impact performance for the user.
Scheduled scripts, on the other hand, are intended for data manipulation, as well as adjustments and integrations to external applications. If your functionality is a heavier lift, a scheduled script is better suited to handle it.
With these two types of scripts, you have a wealth of opportunity to expand OpenAir and extend its functionality while customizing for your particular business needs.
For instance, Top Step has helped businesses by creating scheduled scripts that summed the total of planned or booked hours on all project tasks and moved that to the budget hours field, eliminating the need for a human to do so manually. Another example was an integration between OpenAir and Quickbooks that created sales receipts from invoices.
Form scripts can also improve reporting. Creating a script that doesn’t allow negative numbers to be entered into a time entry form can prevent bad data from making its way into your database. You can hear additional examples of both form and scheduled scripts in our webinar, Learn How to Expand the Boundaries of Your OpenAir Systems.
The OpenAir Scripting Center
Scripts are developed in OpenAir using Javascript. OpenAir also provides a development environment in which to develop scripts; This is the scripting center found within the Administration menu. The Scripting Center provides a place to create scripts without damaging data integrity or systems performance and provides functions and examples for rapid script development.
The Scripting Center offers several functions to help you create and test your scripts.
Scripting Studio – This is the main area for creating scripts. Here, the test owner, initial functions, and libraries that will be called are identified.
SOAP Explorers – The SOAP Explorer contains all of the tables and fields available for script use. Here you’ll be able to see all of the fields related to the objects which can be accessed and updated in your scripts.
Function Explorer – Here, you’ll find all of the OpenAir specific JavaScript functions, including examples of how they are used and code snippets that you can cut and paste into your own code as a starting point.
Scripting Parameters – Script parameters allow for data to be changed outside of the JavaScript function such that the script itself doesn’t need to be modified and redeployed.
Custom Fields – Trying to remember the fields and tables you need for your script can be difficult and can create a lot of back and forth and time wasted. Custom fields within the Scripting Center displays the instance-specific fields and tables, so you don’t need to leave the tool to find that information.
Terminology – Similar to customer fields, terminology displays instance-specific information on the terminology for the instance that you’re working with.
OpenAir Scripting Best Practices and Limitations
When creating scripts for OpenAir, understanding how your scripts run and the resources they use are important not only for tracking, alerting, and debugging scripts, but also to stay within the limits of what OpenAir allows.
Use Logging Liberally
While OpenAir’s development environment offers a lot of help and features, it doesn’t provide for debugging within the tools. Instead, the platform provides script logging, which can help with development as well as with management and support long term.
Using logging fairly liberally will ensure that you get the information that you need to find and remediate issues in your scripts. OpenAir script logging offers six levels of notifications that you can assign to a log event:
- Fatal
- Error
- Warning
- Info
- Debug
- Trace
Assigning a log level to your logged script event will simplify troubleshooting during development and support, and will provide clarity on what is happening within the functionality you’ve created.
Usage Governance
To protect resources within your OpenAir instance, the platform places limits on scripting. This is done by limiting script run time and limiting the amount of data accessed by the script. OpenAir measures this in units.
Different functions use different numbers of units. Reading a value from a form, like in our negative time entry example, is one unit. Writing an error message is four. Reading values from the database are 20 units, plus 10 units for each record read.
There are also different unit and time requirements depending on the type of script. At the time this article was written, form scripts could run no longer than 5 seconds with a 1000 unit limit, among other restrictions. For a scheduled script, the run time is restricted to one hour and one million governance units. These unit limits are separate from OpenAir’s API or BI governance units.
If you’re looking for ways to add functionality to OpenAir that better meet your business processes, scripting is a powerful tool that can get you there. If you’re looking for more information on script usage, check out our webinar, Learn How to Expand the Boundaries of Your OpenAir System.
Do you have specific questions on how OpenAir’s form or scheduled scripts can streamline your processes and improve your reporting? Top Step has helped many companies create customized logic within their platforms, leading that to better visibility and more profitable professional services management.