Field Service ManagementReference

Basic Syntax

Documentation article about Basic Syntax

·2 min read·NetSuite 2026.1·View Oracle Docs

Basic Syntax

Basic Syntax

To understand the syntax of a simple search, we'll use the sample below:

{

"record": "supportcase",

"filters": ["internalid","anyof","${event.supportcase || 0}"],

"map": {

"id": "internalid",

"label": "casenumber"

} }

The record property sets the search type to run or the record type to search for. In the sample above, we're searching for Case records. You can find the ID of the record or search type using the NetSuite record browser. For more information see, Working with the SuiteScript Records Browser.

The filters property sets the search criteria.

The map property sets what results will be returned. In this example, you'll get back an object with two properties: id and label.

--- Context from https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_N3169369.html --- To access the SuiteScript Records Browser, use the following link:

Go to the SuiteScript Records Browser

Important:

When writing SuiteScript, you must use the IDs listed in the NetSuite Help Center. You can access IDs by viewing a NetSuite record's page source, but not all IDs in the source code are supported in SuiteScript. If you create a script that references an unsupported or undocumented ID, and NetSuite later changes the ID, your script may break.

Not all fields in the SuiteScript Records Browser can be set using SuiteScript. Some fields are read only. Check the NetSuite UI to see if a field can be set. Generally, if you can set a field in the UI, you can set it using SuiteScript. If you cannot set a field in the UI, you cannot set it using SuiteScript. However, you can still get the field's value using SuiteScript.

The SuiteScript Records Browser provides a summary of all records, fields, sublists, search joins, search filters, search columns, and record transformations that are supported in SuiteScript. Information about elements is displayed as a series of tables.

To find SuiteScript-supported records and IDs:

Open the SuiteScript Records Browser.

Only records that officially support SuiteScript are listed in the SuiteScript Records Browser.

Click the record you want to reference in SuiteScript.

All IDs currently supported for the record are listed.

The following table provides examples of objects and methods that use each type of ID:

ID Type

Object Examples

Method Examples

Field IDs

serverWidget.Field

record.Field

record.Record

currentRecord.CurrentRecord

Record.getField(options)

CurrentRecord.getField(options)

Record.setValue(options)

CurrentRecord.setValue(options)

record.submitFields(options)

search.lookupFields(options)

Sublist and sublist field IDs

serverWidget.Sublist

Record.commitLine(options)

CurrentRecord.commitLine(options)

Record.getCurrentSublistValue(options)

CurrentRecord.getCurrentSublistValue(options)

Record

Frequently Asked Questions (4)

What are the prerequisites for using SuiteScript to perform searches on NetSuite records?
To perform searches using SuiteScript, you need access to the SuiteScript Records Browser to ensure you're using supported record IDs and fields. Additionally, make sure you are referencing IDs listed in the NetSuite Help Center, as unsupported IDs might break your script if they change.
Can I modify all record fields via SuiteScript?
No, not all fields can be modified via SuiteScript. Some fields are read-only and can only be retrieved. Generally, if a field can be set in the NetSuite UI, it can be set using SuiteScript.
How does the 'map' property work in a SuiteScript search object?
The 'map' property in a SuiteScript search object defines the structure of the results returned. It will map the resulting data fields to specified properties, like 'id' and 'label' in the provided sample code, to include them in the returned search results.
What should I be cautious of when referencing record IDs in SuiteScript?
When using record IDs in SuiteScript, ensure they are supported by checking the SuiteScript Records Browser, as unsupported or undocumented IDs may change, causing your script to break.

Weekly Update History (1)

Field Service Managementupdated

Updated the Nested Searches topic to include an example.

View Oracle Docs
Source: Basic Syntax Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?