keyControl.unlock(options)
Method Description |
Unlocks a key that has been locked with keyControl.lock(options). For more information, see Locking and Restricting Certificates. |
Returns |
void |
Supported Script Types |
Server scripts For additional information, see SuiteScript 2.x Script Types. |
Governance |
10 units |
Module |
|
Since |
2021.1 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
The script ID or internal ID for the key you want to unlock. You can view the ID of a key from the Private Keys list at Setup > Company > Keys. |
2021.1 |
Errors
Error |
Thrown If |
---|---|
|
The key with the ID provided does not exist in this account. |
|
The current employee or script does not have permission to access or edit the key. This can happen if the key is restricted to specific scripts or employees on the key record using the Restrict to Scripts or Restrict to Employees fields. |
|
The key is not locked and cannot be unlocked. |
Syntax
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
...
//load the key object
var loadedKey = keyControl.loadKey({
scriptId : 'custkey_testid'
});
//lock the key
loadedKey.unlock({
id: 'custkey_testid'
});
///save the key
loadedKey.save();
...
// Add additional code