Creating a Custom Plug-in Interface
The interface is central to the custom plug-in model. A custom plug-in's interface defines the functions that run within the custom plug-in script. A custom plug-in script can be any server script type except a Mass Update script. Note that client scripts can't be used as custom plug-in scripts.
Functions defined in a custom plug-in's interface are only called within the custom plug-in script's code.
The functions in an interface are not fully defined. Each function includes a signature (the function name and parameters) and a return type, but no body.
For each function in the interface, define the function name, parameters, return type, and any requirements that implementations must follow. If a function takes an object parameter, document the required and optional properties.
For example, an interface might define the following functions:
|
Function |
Parameters |
Return Type |
|---|---|---|
|
|
|
Number |
|
|
None |
String |
The interface is not a separate SuiteScript file and does not have an @NScriptType value. SuiteScript 2.x default and alternate implementation scripts that implement the interface use @NScriptType plugintypeimpl. For more information, see Creating the Default Implementation for a Custom Plug-in.
An implementation fully defines each function in the interface and the logic they run. You must define a default implementation of the interface. If needed, you can also define one or more alternate implementations of the interface.
Each implementation must keep the signature and return type defined in the interface.
Related Topics
- Custom Plug-in Overview
- Custom Plug-in Development
- Creating the Default Implementation for a Custom Plug-in
- Adding the Default Implementation to NetSuite
- Instantiating a Custom Plug-in Script in SuiteScript 2.x
- Instantiating a Custom Plug-in Script in SuiteScript 1.0
- Adding a Script that Instantiates a Custom Plug-in to NetSuite
- Bundling a Custom Plug-in
- Custom Plug-in Creation