cache.Scope

Note:

The content in this help topic pertains to SuiteScript 2.0.

Note:

JavaScript does not include an enumeration type. The SuiteScript 2.0 documentation uses the term enumeration (or enum) to describe a plain JavaScript object with a flat, map-like structure. In this object, each key points to a read-only string value.

Enum Description

Holds the string values that describe the availability of the cache. Use this enum to set the value of the Cache.scope property and the options.scope parameter of the cache.getCache(options) method.

Type

enum

Supported Script Types

Server scripts

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

Module

N/cache Module

Sibling Module Members

N/cache Module Members

Since

2016.2

Values

Value

Description

PRIVATE

The cache is available only to the current script. This is the default value.

PROTECTED

The cache is available only to some scripts:

  • If the script is part of a bundle, the cache is available to all scripts in the same bundle.

  • If the script is not in a bundle, the cache is available to all scripts not in any bundle.

PUBLIC

The cache is available to all server scripts in the NetSuite account.

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

            //Add additional code 
...
var myCache = cache.getCache({
    name: 'temporaryCache',
    scope: cache.Scope.PROTECTED
});
...
//Add additional code 

          

Related Topics

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

General Notices