Form.addSecretKeyField(options)
Method Description |
Adds a secret key field to the form. This key can be used in crypto modules to perform encryption or hashing.
Important:
The default maximum length for a secret key field is 32 characters. If needed, use the Field.maxLength property to change this value. |
Returns |
serverWidget.Field object |
Supported Script Types |
Suitelets User event scripts -beforeLoad entry point For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2016.1 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
The internal ID of the secret key field. The internal ID must be in lowercase, contain no spaces, and include the prefix custpage if you are adding the field to an existing page. |
2016.1 |
|
string | string[] |
required |
The ID or list of IDs of the scripts where the key can be used. |
2016.1 |
|
string |
required |
The UI label for the field. |
2016.1 |
|
Boolean |
optional |
Controls whether use of this secret key is restricted to the same user that originally entered the key. By default, the value is If set to |
2016.1 |
|
string |
optional |
The internal ID of the tab or field group to add the field to. By default, the field is added to the main section of the form. |
2016.1 |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/ui/serverWidget Module Script Samples. For a complete script example that uses Form.addSecretKeyField(options), see N/crypto Module Script Samples.
//Add additional code
...
var form = serverWidget.createForm({
title : 'Simple Form'
});
skField = form.addSecretKeyField({
id : 'password',
restrictToScriptIds : 'customscript_my_script',
label : 'Password',
restrictToCurrentUser : false
});
skField.maxLength = 64;
...
//Add additional code