keyControl.findKeys(options)

Note:

The content in this help topic pertains to SuiteScript 2.0 and SuiteScript 2.1.

Method Description

Returns a list of keys that are available to the user.

Returns

Metadata about the keys

Supported Script Types

Server scripts

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

Governance

10 units

Module

N/keyControl Module

Since

2019.2

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.restriction

number

optional

The internal ID of an employee selected in the Restrict to Employees field.

2019.2

options.name

string or object

optional

The name of the key.

The properties of the object are:

  • value is a string, which can be used if object is used instead of string.

  • operator is one of the keyControl.Operator enum values.

  • ignoreCase is either true or false.

If the object is used, the value is required. Operator defaults to equals and ignoreCase defaults to true.

2019.2

options.description

string or object

optional

The description of the key.

The properties of the object are:

  • value is a string, which can be used if object is used instead of string.

  • operator is one of the keyControl.Operator enum values.

  • ignoreCase is either true or false.

If the object is used, the value is required. Operator defaults to equals and ignoreCase defaults to true.

2019.2

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/keyControl Module Script Samples.

              // Add additional code  
...
require(['N/keyControl'],function(keyControl){
    var keys = keyControl.findKeys({
        name:{value: 'test', 
              operator: keyControl.Operator.CONTAINS,
              ignoreCase:true}
});
...
// Add additional code 

            

Related Topics

General Notices