search.createSetting(options)
Method Description |
Creates a new search setting and returns it as a search.Setting object. Search settings let you specify search parameters that are typically available only in the UI. The following settings are supported:
After you create your settings, assign them as array values to Search.settings. |
Returns |
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2018.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
The name of the search parameter to set. This value sets the Setting.name property. Use one of the following values for this parameter:
|
2018.2 |
|
string |
required |
The value of the search parameter. If you are executing a joined search, this value is the join ID used for the search field specified by the If you specify
The default value is If you specify
The default value is These values are not case sensitive. |
2018.2 |
Errors
Error Code |
Thrown If |
---|---|
|
An unknown search parameter name is provided. |
|
An unsupported value is set for the provided search parameter name. |
|
A required parameter is missing. |
Syntax
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 mySearch = search.create({
type: 'transaction',
columns: [ 'trandate', 'amount', 'entity' ],
filters: [
search.createFilter({
name: 'internalid',
operator: search.Operator.ANYOF,
values: [13, 12356]
})],
settings: [
search.createSetting({
name: 'consolidationtype',
value: 'NONE'
})]
});
...
//Add additional code