search.global(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Performs a global search against a single keyword or multiple keywords.

Similar to the global search functionality in the UI, you can programmatically filter the global search results that are returned. For example, you can use the following filter to limit the returned records to Customer records:

'cu: simpson'

The search.global(options) method also includes a promise version, search.global.promise(options). For more information about promises, see Promise Object.

For more information about global search, see Global Search.

Returns

search.Result[] as an array of result objects containing these columns: name, type, info1, and info2

Results are limited to 1000 records.

If there are no search results, this method returns null.

Supported Script Types

Client and server scripts

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

Governance

10 units

Module

N/search Module

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.keywords

string

Required

Global search keywords string or expression.

2015.2

Errors

Error Code

Message

Thrown If

SSS_MISSING_REQD_ARGUMENT

{1}: Missing a required argument: {2}

Required parameter is missing.

Syntax
Important:

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

          //Add additional code 
...
var customerSearch = search.global({
    keywords: 'cu: simpson'
});
...
//Add additional code 

        

Related Topics

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

General Notices