addConfigurationField
Function Declaration |
|
Type |
Object function |
Description |
Add a required configuration field for this plug-in to be available on the Bank Connectivity Plug-In Configuration page in NetSuite. Since SuiteScript cannot provide type-safety for the field type, choose the type parameter from one of the following string values:
|
Returns |
void |
Input Parameters |
type – A string chosen from the list of field types (PASSWORD, TEXT, or TESTAREA). label – The label to display on the form.
Note:
The label parameter can be localized by taking into account the input's getLocale function. Otherwise, this output object should be deterministic. dataName – The name of the key used to access the field when accessing the BankConnectivityPluginConfiguration input. required – Specifies whether a field is required. If true, the field is mandatory. The default is false. |
Parent object |
Example
getRequiredConfigurationFields: function (context) {
//Connection details
context.output.addConfigurationField({type:"TEXT", label:"URL", required:true, dataName:"url"});
context.output.addConfigurationField({type:"TEXT", label:"User name", dataName:"username"});
context.output.addConfigurationField({type:"PASSWORD", label:"Password", dataName:"password"});
context.output.addConfigurationField({type:"TEXT", label:"Host Key", dataName:"hostKey"});
context.output.addConfigurationField({type:"TEXT", label:"Host Key Type", dataName:"hostKeyType"});
context.output.addConfigurationField({type:"TEXT", label:"Port", dataName:"port"});
//File download details
context.output.addConfigurationField({type:"TEXT", label:"Download Filename", dataName:"filename"});
context.output.addConfigurationField({type:"TEXT", label:"Download Directory", dataName:"directory"});
context.output.addConfigurationField({type:"TEXT", label:"Download Timeout", dataName:"timeout"});
context.output.addConfigurationField({type:"TEXT", label:"Bank statement format", dataName:"format"});
},
This example mirrors all of the connection details provided by the 'N/sftp' module.
-
URL – The URL of the bank's sFTP server.
-
User name – The user name to connect to the bank's sFTP server.
-
Password – The password for the user.
-
Host Key – The finger print for the bank's sFTP server. For example, a finger print could be "c4:26:ab:cf:a0:15:0a:99:5f:f3:7b:ef:3b:19:d8:96". See Obtaining the Host Key.
-
Host Key Type – The type of host key provided by the bank's server. The host key type is usually RSA.
-
Port – The port the sFTP server is using, which is typically 22 since sFTP is over SSH.