plugin.loadImplementation(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Instantiates an implementation of the custom plugin type.

Returns the implementation which is currently selected in the UI (Manage Plug-ins page) when no implementation ID is explicitly provided.

Returns

An Object implementing the custom plug-in type.

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/config Module

Since

2016.1

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.type

string

required

The script ID of the custom plug-in type.

2016.1

options.implementation

string

optional

The script ID of the custom plug-in implementation.

2016.1

Error Code

Thrown If

UNABLE_TO_FIND_IMPLEMENTATION_1_FOR_PLUGIN_2

Either there is no such implementation of the provided plug-in type, or the plug-in type does not exist.

Syntax
Important:

The following code snippet shows the syntax for this member. It is not a functional example. For a complete script example, see N/plugin Module Script Sample.

          //Add additional code 
...
var pl = plugin.loadImplementation({
    type: 'customscript_sample_plugin'
});
...
//Add additional code 

        

Related Topics

N/plugin Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices