Anyone know how to get the NetSuite account base U...
# suitescript
b
Anyone know how to get the NetSuite account base URL via a SuiteScript 1.0 RESTlet?
b
load the company information configuration
then get the value of the appurl field
🎖️ 1
m
Or you could use this gem from SA
Copy code
var conf = nlapiLoadConfiguration('companyinformation')
var id = conf.getFieldValue('companyid')
var resp = nlapiRequestURL('<https://rest.netsuite.com/rest/datacenterurls?account=>' + id + '&c=' + id)
var parsedResp = JSON.parse(resp.body)
var url = parsedResp.systemDomain;
facepalm 1
b
you only need the first 2 lines now that app url is on the company information
💯 1
m
1000 and the bigger joke is that the code example then proceeds to ignore the
url
as well
b
Got it. Thanks!
Copy code
var companyInfo = nlapiLoadConfiguration('companyinformation');
var baseUrl = companyInfo.getFieldValue('appurl');