cache.getCache(options)
Method Description |
Checks for a cache object with the specified name. If the cache exists, this method returns the cache object. If the cache does not exist, the system creates a cache and returns the created cache object. |
Returns |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Module Members |
|
Since |
2016.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
The name of the cache to be retrieved or created. The maximum size of the cache name is 1 kb. |
|
string |
optional |
Sets the availability of the cache. A cache can be made available to the current script only, to all scripts in the current bundle, or to all scripts in your NetSuite account. Set this value using the cache.Scope enum. The default value is |
Syntax
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.PUBLIC
});
...
//Add additional code