format.getPhoneNumberParser(options)

Note:

The content in this help topic pertains to SuiteScript 2.x.

Method Description

Parses a phone number from a string. Returns a format.PhoneNumberParser object.

Returns

Object

Supported Script Types

Client and server scripts

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

Governance

10 units

Module

N/format/i18n Module

Methods and Properties

N/format/i18n Module Members

Since

2019.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.defaultCountry

enum

optional

Parser point of reference. Specify this value if the phone number is not in international formatl. If specified, value must be a format.Country value. If a value is not specified, the company country is used.

2020.2

Warning:

These parameters are mutually exclusive, you can always use only one of them.

Errors

Error Code

Thrown If

SSS_INVALID_COUNTRY_ID

An invalid value is specified for the defaultCountry parameter. Value must be a format.Country value.

Related Topics

N/format/i18n Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices