url.resolveScript(options)
Method Description |
Returns an external or internal URL to a RESTlet or Suitelet |
Returns |
string |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.1 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string | number |
required |
The script ID (string) or internal ID (number) of the deployment script. |
2015.1 |
|
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 |
|
Object |
optional |
The object containing name/value pairs to describe the query. |
2015.1 |
|
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). Note the following URLformats:
|
2015.1 |
Syntax
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