Plug-in Implementation Script File Creation for SuiteScript 1.0
You can use the SuiteCloud IDE, or another JavaScript IDE or text editor, to create a JavaScript file that includes the business logic for your Custom GL Lines plug-in implementation script file.
The following table describes the functions and objects available in a Custom GL Lines plug-in implementation script file:
Function / Interface Object |
Description |
---|---|
customizeGlImpact(transactionRecord, standardLines, customLines, book) |
You must create an implementation of this function in the plug-in implementation script file. The script file can contain other helper functions. NetSuite executes this function when you save a transaction of the type and subsidiary configured for the plug-in implementation. NetSuite executes this function one time for the primary accounting book. If you use the Multi-Book Accounting feature, this function is also called for each secondary accounting book that you configure for the plug-in implementation. |
Contains an array of all standard lines with GL impact in a transaction as StandardLine objects. Use the methods available to this object to access the properties of individual standard lines with GL impact on a transaction. |
|
Contains an array of all custom lines with GL impact in a transaction as CustomLine objects. Use the methods available to this object to add and modify custom lines with GL impact on a transaction. |
|
Represents the accounting book passed to a Custom GL plug-in implementation when you save a transaction. Use the methods available to the book object to determine if the book is a primary or secondary book or get the internal NetSuite ID of the accounting book. |
|
Use this to access properties of the transaction with SuiteScript API nlobjRecord functions. You cannot modify the transaction. When you create a new transaction in synchronous mode, the record ID is not available. |
For more information, see the Custom GL Lines Plug-in Process Flow and Custom GL Lines Plug-in Implementation Object Model for SuiteScript 1.0.
Custom GL Lines Plug-in Implementation Object Model for SuiteScript 1.0
The following diagram shows the object model for the interface input and output objects:
Rules and Guidelines
Use the following rules and guidelines when creating the plug-in implementation script file:
-
The plug-in script file can have any name, provided it contains an implementation of the interface function.
-
If you want to create utility files with helper functions for the main implementation file, you can include those files when you create the plug-in implementation for the Custom GL Lines plug-in in NetSuite. For more information about utility files, see Utility Files for a Custom GL Lines Plug-In Implementation.
-
You can use a custom record type to store the references to the required NetSuite standard records. See Using a Custom Record to Reference Internal NetSuite IDs Example.
-
You can use SuiteScript API functions in a plug-in implementation, for example, nlapiLoadRecord(type, id, initializeValues) and nlapiSearchRecord(type, id, filters, columns). For more information, see SuiteScript 1.0 API Reference and SuiteScript 2.x API Reference. However, using these APIs may negatively affect the performance of the plug-in implementation. Limit the use of these APIs, where possible, to improve performance of the plug-in implementation. In general, searching for records yields better performance than loading NetSuite records.
Governance limits also apply to these functions. The plug–in script file allows up to 1000 usage units when used with SuiteScript. For more information, see SuiteScript 1.0 API Governance in SuiteScript 1.0 and SuiteScript 2.x API Governance.
For additional guidelines and best practices, see Custom GL Lines Plug-in Guidelines and Best Practices.