Dataset Builder Plug-ins as XML Definitions

Note:

Dataset Builder Plug-in objects in SuiteCloud Development Framework (SDF) only support SuiteScript 2.x.

You can create and manage a Dataset Builder Plug-in implementation in a SuiteCloud project and deploy it to a target NetSuite account. The Dataset Builder Plug-in enables you to create custom datasets that fit your business needs. You can override the createDataset() function and create a dataset that contains a specific subset of data or a dataset that uses custom logic. For example, you can create a dataset based on user-specific or role-specific information. The default behavior in the N/dataset module does not permit you to do this, which makes the Dataset Builder Plug-in a good choice for these use cases. Datasets you create using the N/dataset module are static and cannot use dynamic information such as the current role, current user, and so on.

For information about using Dataset Builder Plug-ins, see Dataset Builder Plug-in Interface Overview.

You can also import a Dataset Builder Plug-in implementation from a NetSuite account into a SuiteCloud project. For more information about importing objects, see Account Component Imports to SuiteCloud Projects.

Customizing a plug-in implementation object from your SuiteCloud project is the equivalent of editing or making a new plug-in implementation from the NetSuite UI. For example, select Customization > Plug-ins > Plug-in Implementation > New from a NetSuite account.

To create a Dataset Builder Plug-in implementation in a SuiteCloud project, you must create a plug-in implementation script file. For details, see Creating a Dataset Builder Plug-in Script File.

Dataset Builder Plug-in implementations in SDF are represented with the datasetbuilderplugin object. To define this object, see the following sections:

Create a Dataset Builder Plug-in Implementation Script File

You need to have a Dataset Builder Plug-in implementation script either in the target account, or in the same SuiteCloud project as your XML object. For more information, see Creating a Dataset Builder Plug-in Script File and SuiteScript Files in SuiteCloud Projects.

Dataset Builder Plug-in Implementation Required Fields

The following table contains fields that are required for datasetbuilderplugin objects. For a list of all available fields, see datasetbuilderplugin.

Element

Type

Description

name

string

A user-friendly name for the Dataset Builder Plug-in implementation. The name is seen by administrators when they activate or deactivate the Dataset Builder Plug-in implementation.

This field value can be up to 40 characters long.

scriptfile

filereference

The script file (.js) that contains the implementation for the Dataset Builder Plug-in.

This field must reference a .js file.

Dataset Builder Plug-in Implementation Object Example

The following is an XML definition example of a Dataset Builder Plug-in implementation object in a SuiteCloud project.

The Dataset Builder Plug-in implementation object, customscript_dataset, creates a new plug-in that is in TESTING status. Debugging messages are logged when the script is run. The owner of the object is notified whenever an error is thrown. The datasetbuilder.js script is called when NetSuite receives a request to create a custom dataset.

Note:

Each datasetbuilderplugin SDF custom object requires a scriptfile field reference to a SuiteScript file that implements interface functions. For more information, see Creating a Dataset Builder Plug-in Script File. This script file can be in the target account or in the same SuiteCloud project as your plug-in implementation object.

            <datasetbuilderplugin scriptid="customscript_dataset">
    <description></description>
    <isinactive>F</isinactive>
    <loglevel>DEBUG</loglevel>
    <name>My Dataset Builder</name>
    <notifyadmins>F</notifyadmins>
    <notifyemails/>
    <notifyowner>T</notifyowner>
    <notifyuser>F</notifyuser>
    <runasrole/>
    <scriptfile>[/SuiteApps/datasetbuilder.js]</scriptfile>
    <status>TESTING</status>
</datasetbuilderplugin> 

          

For more information about the fields in the preceding example, see datasetbuilderplugin.

Related Topics

Plug-ins
Custom Plug-ins as XML Definitions
Custom GL Lines Plug-ins as XML Definitions
Email Capture Plug-ins as XML Definitions
Financial Institution Connectivity Plug-ins as XML Definitions
Financial Institution Parser Plug-ins as XML Definitions
Bank Statement Parser Plug-ins as XML Definitions
Workbook Builder Plug-ins as XML Definitions

General Notices