Creating a Custom Plug-in Type in an XML Definition

In SuiteCloud Development Framework (SDF), custom plug-in types are represented by plugintype objects.

To create a plugintype object, perform one of the following procedures:

Procedure

Details

In SuiteCloud IDE, create a custom plug-in implementation in a NetSuite account .

See Creating a Custom Plug-in Default Implementation.

In the NetSuite interface, create a custom plug-in type in a NetSuite account.

See Creating a Custom Plug-in Default Implementation.

Import the plugintype object into your SuiteCloud project. See Account Component Imports to SuiteCloud Projects.

In the SuiteCloud Extension or in the SuiteCloud IDE, create a custom plug-in implementation using a template.

See Creating a SuiteScript File in SuiteCloud Extension for Visual Studio Code.

See Creating an XML Definition for an SDF Custom Object in SuiteCloud IDE Plug-in for WebStorm.

Custom Plug-in Type Required Fields

The following table contains fields that are required for custom plugintype objects. For a list of all available fields, see the reference documentation for the plugintype element in SuiteCloud Development Framework XML Reference.

Note:

The scriptid attribute is required for the plugintype element. The scriptid attribute value must match the filename excluding the file extension.

For SuiteScript 1.0 custom plug-in types:

  • The class field is required. The class field value represents the custom plugin. Format the class name in Pascal case (PascalCase). Use the class name to instantiate the implementation you want to use in your custom plug-in script. For more information, see Instantiating a Custom Plug-in Script in SuiteScript 1.0.

  • If you are using a library, use the libraries element to add library files that support your implementation.

Field

Type

Description

deploymentmodel

single-select list

The number of custom plug-in type implementations that an administrator can activate at one time.

Possible values are:

  • ALLOW_MULTIPLE indicates two or more implementations of the interface can be activated at the same time within an account.

  • ALLOW_SINGLE indicates only one implementation of the interface can be activated at any time within an account.

name

string

A user-friendly name for the custom plug-in type. This name is seen by solution implementors when they create alternate implementations of the plug-in type. The name is also seen by administrators when they activate or deactivate implementations of this type.

scriptfile

filereference

The script file (.js) that contains the default implementation for the custom plug-in type.

status

single-select list

The status of the custom plug-in type. Possible values are RELEASED and TESTING. Ensure the value is set to RELEASED prior to bundling the custom plug-in. See Bundling a Custom Plug-in.

Custom Plug-in Type Methods

Specify the functions from the script file using the methods element.

Functions are specified using the following fields:

Field

Type

Description

method

string

The name of a function defined in the interface. Do not include parentheses or parameters.

description

string

A description for the method.

For an example of a plugintype object that contains methods, see Custom Plug-in Type Object Example.

Related Topics

Creating a Custom Plug-in in an XML Definition
Creating a Custom Plug-in Implementation in an XML Definition

General Notices