crypto.checkPasswordField(options)
Method Description |
Checks whether a password in a record corresponds to the password entered by the user. Use this method instead of Record.getValue(options) or CurrentRecord.getValue(options) on a custom password field. You should no longer use those methods for custom password fields. This method provides a more secure way to check custom password fields. |
Returns |
boolean |
Supported Script Types |
Server scripts For additional information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2021.1 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
ID of the password field. |
2021.1 |
|
number |
optional |
Zero-based line index of the password field if the password is on a line. |
2021.1 |
|
number |
required |
ID of the record that has the password field. |
2021.1 |
|
string |
required |
Type of record that has the password field. |
2021.1 |
|
string |
optional |
ID of the sublist if the password field is on a sublist line. |
2021.1 |
|
string |
required |
Input password value to be checked against the password stored in the record. |
2021.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/crypto Module Script Samples.
//Add additional code
...
var options = {
recordType: record.Type.SALES_ORDER,
recordId: 6,
fieldId: 'custitem1',
sublistId: 'item',
line: 0,
value: 'theenteredpassword'
};
if (crypto.checkPasswordField(options)) {
log.debug('True');
} else {
log.debug('False');
}
...
//Add additional code