Guidelines for Creating a Workbook Builder Plug-in Implementation Script File
The following guidelines apply when creating a Workbook Builder Plug-in implementation script file:
-
If you create an invalid workbook using a Workbook Builder Plug-in, the workbook may produce an unexpected error in the SuiteAnalytics Workbook UI, or you may receive a "Workbook does not exist" or "Workbook is no longer available" error. These errors may occur if there are syntax or logic errors in the code used to create the workbook in the plug-in. The invalid workbook will appear in the list of available workbooks, but you will not be able to load it or work with any of its elements (such as table views and pivots).
To work around this issue, you should test your workbook creation code in the SuiteScript Debugger before using it in your plug-in implementation script file. When the workbook creation code is syntactically correct, the workbook will appear in the SuiteAnalytics Workbook UI. However, if the code includes logic errors, some elements (such as pivots or charts) may not be displayed correctly.
To test for syntax errors, copy your workbook creation code into the debugger and run it. The debugger will identify any syntax errors before executing the workbook creation code. To test for logic errors, run the workbook visualizations in the debugger using methods that are available for workbook visualization types. For example, you can use Workbook.runPivot(options) to test the creation of pivots in your workbook. If you do not receive errors in the debugger, your workbook creation code is safe to use in your plug-in implementation script file and will not produce errors in the SuiteAnalytics Workbook UI. For more information about the SuiteScript Debugger, see SuiteScript Debugger.
-
When you create a workbook using a Workbook Builder Plug-in, the workbook name in the SuiteAnalytics Workbook UI appears as the name of the plug-in deployment script record instead of the workbook name that is specified in the plug-in. The dataset name will appear as the dataset name that is specified in the plug-in.
The following general guidelines apply when creating a plug-in implementation script file:
-
The plug-in script file can have any name, provided it has a .js extension and contains an implementation of each interface function.
-
You can include utility files with helper functions when you create the plug-in implementation.
-
Due to limitations with how strings are handled in NetSuite, you cannot use the JavaScript
case
statement in the plug-in implementation script file. -
The plug-in allows up to 1000 usage units. For more information, see SuiteScript Governance and Limits.
-
If the character limit is exceeded in a field, the value will be truncated.