url.format(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Creates a serialized representation of an object containing query parameters.

Use the returned value to build a URL query string.

Returns

URL as a string

Supported Script Types

Client and server scripts

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

Governance

None

Module

N/url Module

Since

2015.1

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.domain

string

required

The domain name.

2015.1

options.params

Object

required

Additional URL parameters as name/value pairs.

2015.1

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/url Module Script Samples.

For a script that uses the following code sample, the returned output is http://fruitland.com?fruit=grape&seedless=true&variety=Concord+Giant&PLU=4272, expressed as a string.

          //Add additional code 
...
var output = url.format({
    domain: 'http://fruitland.com',
    params: {
        fruit: 'grape',
        seedless: true,
        variety: 'Concord Giant',
        PLU: 4272
    }
});
...
//Add additional code 

        

Related Topics

N/url Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices