SecureString.appendString(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Appends a string to an https.SecureString.

You should use this method only for appending a string (UTF-8) content to an . https.SecureString

Returns

https.SecureString

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/https Module

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.input

string

required

The string to append. The following patterns are accepted:

  • \{[a-fA-F0-9]{32}\} or alternatively { + <32 hexadecimal characters forming a UUID/GUID> + }

  • \{custsecret[a-zA-Z0-9_]{1,89}\} or alternatively { + custsecret + <1 up to 89 alfanumeric characters or underscores > + }

  • specific payment-plugin tokens

options.inputEncoding

string

optional

The encoding of the string that is being appended.

Use values from the https.Encoding enum.

The default value is https.Encoding.UTF_8.

Note:

This parameter is deprecated; you should use this method only for appending a string (UTF-8) content to a SecureString.

options.keepEncoding

boolean

optional

Keeps the appended string in its original encoding. Set this value to true to prevent unexpected content re-encoding.

The default value is false.

Errors

Error Code

Thrown If

FAILED_TO_CONVERT_BINARY_DATA_TO_UTF_8

The options.keepEncoding parameter is set to false and an invalid attempt to re-encode from binary to string data occurred during the append.

FAILED_TO_DECODE_STRING_ENCODED_BINARY_DATA_USING_1_ENCODING

The options.keepEncoding parameter is set to false and an invalid attempt to re-encode from string to binary data occurred during the append.

INVALID_VALUE_1_FOR_PARAMETER_2

The options.InputEncoding parameter is set to a value other than https.Encoding.UTF_8 and the options.keepEncoding parameter is set to true.

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/https Module Script Samples.

          // Add additional code 
...
var regularString1 = "myString1";

var secureString1 = https.createSecureString({
    input: "myString2"
});
secureString1.appendString({
    input: regularString1,
    keepEncoding: true
});
// secureString1 will now be "myString1myString2"
...
// Add additional code 

        

Related Topics

https.SecureString
N/https Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices