url.resolveScript(options)

Method Description

Returns an external or internal URL to a Suitelet

Returns

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.deploymentId

string | number

required

The script ID (string) or internal ID (number) of the deployment script.

2015.1

options.scriptId

string | number

required

The script ID (string) or internal ID (number) of the script. The ID must identify a RESTlet or a Suitelet.

2015.1

options.params

Object

optional

The object containing name/value pairs to describe the query.

2015.1

options.returnExternalUrl

boolean

optional

Indicates whether to return the external URL. Setting this value to true requires that the script is run in a trusted context for authenticated users.

By default, the internal URL is returned (that is, the default value is false). You can only use the internal URL for this method in client scripts. To call a Suitelet with its internal URL from a server script, use https.requestSuitelet(options).

2015.1

Errors

Error Code

Message

Thrown If

SSS_INVALID_URL

 

You attempt to call a Suitelet using its internal URL from a server script.

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.

          //Add additional code 
...
var output = url.resolveScript({
    scriptId: 'custom_script',
    deploymentId: 'custom_script_deployment',
    returnExternalUrl: false
});
...
//Add additional code 

        

Related Topics

General Notices