Session.get(options)
Method Description |
Returns the user-defined session object value associated with a session object key. Both the session object value and associated key are defined using Session.set(options) (supported in server scripts only). If the key does not exist, this method returns null. |
Returns |
string | null |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
Key used to store the session object. |
2015.2 |
Errors
Error Code |
Thrown If |
---|---|
|
The |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/runtime Module Script Samples.
// Add additional code
...
var sessionObj = runtime.getCurrentSession();
sessionObj.set({
name: 'myKey',
value: 'myValue'
});
log.debug('Session object myKey value: ' + sessionObj.get({name: 'myKey'});
...
// Add additional code