Discoverable Procedures

Discoverable procedures in the NetSuite (BDK) Book.

circle-exclamation

Overview

In NetSuite, an entity is any object or record type that stores business data, such as a customer, employee, sales order, or custom record. Entities define how information is structured, including the fields, relationships, and operations available for that data.

Discovery scans your connected NetSuite account to identify these entities, their fields, and the actions they support. Each discovery generates these five automation procedures for a given entity:

  1. Create: Add new records to NetSuite.

  2. Retrieve: Fetch preview lists of records.

  3. Retrieve Record Details: Get full record details including nested data.

  4. Update Record: Modify existing records with new data.

  5. Upload File Attachment: Upload files to NetSuite and link them to records.

Discovery

Use the following syntax to discover entities from your NetSuite instance and generate automation procedures. Replace ENTITY with the entity type to be discovered:

discover "ENTITY" from netsuite

NetSuite Entities

To view all discoverable entities, use:

retrieve discoverables from netsuite

Common NetSuite entities include:

  • People: customer, employee, vendor, partner, contact

  • Items: item, inventoryItem, serviceItem, kitItem

  • Transactions: salesOrder, invoice, purchaseOrder

  • Support: supportCase, task, phoneCall

  • Custom Records: Your custom record types (e.g., customrecord_myrecord)

circle-info

Entity Names

NetSuite entity names use camelCase:

  • customer (lowercase for simple entities)

  • salesOrder (camelCase for compound names)

Check out NetSuite's REST API documentationarrow-up-right for additional details.

Examples


Procedures

After discovery, you can use the five generated procedures for that entity:

1. Create Record

Create a new record of the discovered entity type.

Parameters

Parameter
Description
Required?

the body is [DATA]

The data for the new record

Yes

Example

Returns: The newly created record with preview fields populated (includes ID and basic information).

Important Notes

  • Only required and create-able fields need to be provided

  • NetSuite will generate system fields like ID, creation date, etc.

  • The returned record is a "preview" version with essential fields


2. Retrieve Records

Get a list of records from the discovered entity type using SuiteQL queries.

Parameters

Parameter
Description
Required?

the limit is [NUMBER]

Maximum number of records to retrieve (default: 10)

Optional

the offset is [NUMBER]

Number of records to skip for pagination (must be a multiple of the limit)

Optional

whose [FIELD] is [VALUE]

Filter records by specific criteria.

Note: Filter expressions are case-sensitive (e.g., "KOGNITOS" ≠ "Kognitos"). Use the "has" operator for partial matching, "is" for exact matching.

Optional

Examples

Returns: A list of preview records matching the criteria.

Important Notes:

  • Uses SuiteQL for efficient querying

  • Returns "preview" records (lighter weight with essential fields)

  • Offset must be a multiple of the limit

  • For full record details, use the "retrieve details" procedure


3. Retrieve Record Details

Get the complete, detailed information for a specific record. Use this procedure when you need all the record information and not just the preview fields.

Parameters

Parameter
Description
Required?

the record is [RECORD]

The preview record to get full details for

Yes

Example

Returns: The complete record with all fields and nested data.


4. Update Record

Update an existing record with new data.

Parameters

Parameter
Description
Required?

the record is [RECORD]

The record with updated data (must include ID)

Yes

Example

Returns: The updated record with current values.

Important Notes:

  • Only sends fields that have changed (differential update)

  • Automatically fetches remote record to compute differences

  • More efficient than sending entire record


5. Upload File Attachment

Upload a file to NetSuite's File Cabinet and attach it to a record. For this procedure, you need to select the folder in which the attachments will be saved.

Parameters

Parameter
Description
Required?

the record is [RECORD]

The record to attach the file to

Yes

the file is [FILE]

The file to upload

Yes

the file name is "[NAME]"

Name for the uploaded file

Yes

the folder id is "[FOLDER_ID]"

Specific File Cabinet folder to upload to

Optional

Examples

Returns: The file ID of the uploaded attachment.

Important Notes:

  • Requires a File Cabinet folder ID (either in call or configured globally)

    • In order to configure a folder ID, you can do:

  • Uses SOAP API for file operations

  • If attachment fails, the uploaded file is automatically deleted (cleanup)

  • File is first uploaded to File Cabinet, then linked to the record


Complete Workflow Examples

1. Retrieving Message Attachments

This example shows how to retrieve messages and download their attachments:

2. Comprehensive Record Management

This example demonstrates schema retrieval, filtering, creating, and updating records:


Understanding Record Types

NetSuite has three record views for discovered entities:

Record Type
Used By
Contains
Purpose
Performance
  1. Preview Records

Retrieve Records, Create Record

Essential fields like ID, name, basic information

Lightweight for listing and selection

Fast — efficient for bulk operations

  1. Detail Records

Retrieve Record Details

All fields including nested data and relationships

Complete record information

Slower — use when you need everything

  1. Create Records

Create Record

Only create-able fields

Defines what you can set when creating

Excludes system-generated and read-only fields

Typical Workflow

  1. Use retrieve to get preview records (fast)

  2. User selects a specific record

  3. Use retrieve details to get complete information (when needed)

Last updated

Was this helpful?