I have a script deployment for a display it will s...
# ask-stanley-ai
a
I have a script deployment for a display it will show the saved search for the URL but not the External URL
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that the URLs for script deployments are not directly exposed in SuiteQL or Saved Searches. However, you can generate the URLs using the
N/url.resolveScript()
function once you have the Script and Deployment IDs. For the external URL, you can use a similar approach but you need to be aware that client scripts run with the permission of the current user. For an external URL, this basically means no permissions since it's public facing. Therefore, you should avoid doing anything that requires permissions in the client script. Instead, you can perform the search in the suitelet and set the data on a field that you use in the client script. Here is a code sample provided in the conversations for generating the URLs:
Copy code
javascript
const ACCOUNT_ID = 'MY_ACCOUNT_ID';

const DEFAULT_RESTLET_EXTERNAL_ID = 'https://' + ACCOUNT_ID + '.<http://restlets.api.netsuite.com/app/site/hosting/restlet.nl?script={RESTLET_SCRIPT_ID}&deploy={RESTLET_DEPLOYMENT_ID}';|restlets.api.netsuite.com/app/site/hosting/restlet.nl?script={RESTLET_SCRIPT_ID}&deploy={RESTLET_DEPLOYMENT_ID}';>

const DEFAULT_RESTLET_INTERNAL_ID = '/app/site/hosting/restlet.nl?script={RESTLET_SCRIPT_ID}&deploy={RESTLET_DEPLOYMENT_ID}';

var restletExternalURL = DEFAULT_RESTLET_EXTERNAL_ID.replace('{RESTLET_SCRIPT_ID}', <ACTUAL_RESTLET_SCRIPT_ID>).replace('{RESTLET_DEPLOYMENT_ID}', <ACTUAL_RESTLET_SCRIPT_DEPLOYMENT_ID>);

var restletInternalURL = DEFAULT_RESTLET_INTERNAL_ID.replace('{RESTLET_SCRIPT_ID}', <ACTUAL_RESTLET_SCRIPT_ID>).replace('{RESTLET_DEPLOYMENT_ID}', <ACTUAL_RESTLET_SCRIPT_DEPLOYMENT_ID>);
Remember to replace
<ACTUAL_RESTLET_SCRIPT_ID>
and
<ACTUAL_RESTLET_SCRIPT_DEPLOYMENT_ID>
with your actual script and deployment IDs. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841742039
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830730438
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827984452
Please provide your feedback on this answer.