I’d like a way to prepare a dynamic report of all ...
# suitescript
j
I’d like a way to prepare a dynamic report of all script deployment records that includes the External URLs of each where applicable. It seems the URLs are not exposed to SuiteQL or Saved Search, am I mistaken? Is the only way to get the external URL to do a record.load of each deployment? That’s not ideal given that we have so many.
e
Once you have the Script and Deployment IDs, you could use
N/url.resolveScript()
to generate either the internal or external URLs, instead of loading.
But I agree with your assessment that the URLs do not appear to be exposed in either searches or queries.
j
For context, I’d love a single page that lists (in nice HTML) all Scripts. with their deployments and links to the: • script record • deployment record • script file in file cabinet • internal URL (where applicable) • external URL (where applicable) • maaaaybe link to script execution logs for that script Basically a nice scripty dashboard, one-stop-shop dealio. I’m lazy. Clicking is hard.
e
All of that seems very doable, just not from a single search/query
j
yeah. I just think it is possible it’ll timeout trying to build it as a Suitelet page that I can view for all my lazyJen links.
we gots lots o scripts
e
Sounds like a simple task for a M/R to create a file with the info you need
c
The internal/external URLs should follow the standard URL format so you should be able to just get the account ID from N/runtime and then do your script/script deployment searches and you can get the info you need and just build the internal/external URLs through string replacement.
Copy code
const ACCOUNT_ID = 'MY_ACCOUNT_ID';

const DEFAULT_RESTLET_EXTERNAL_ID = 'https://' + ACCOUNT_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>);
e
Dear @jen , How dare you. Sincerely, -EG
I wouldn't call it "done" or "good", but it works 😄
j
You have waaaaaaay too much time on your hands. Also I owe you beers.
🍻 1
e
Hurtful! But also it's not altruistic; I get to make content out of it for my community 😄
j
❤️ ❤️ ❤️