screnshaw
10/29/2021, 7:13 PMfkrauthan
10/29/2021, 7:16 PMscrenshaw
10/29/2021, 7:17 PMbattk
10/29/2021, 7:17 PMscrenshaw
10/29/2021, 7:17 PMbattk
10/29/2021, 7:18 PMbattk
10/29/2021, 7:18 PMbattk
10/29/2021, 7:18 PMbattk
10/29/2021, 7:18 PMbattk
10/29/2021, 7:19 PMscrenshaw
10/29/2021, 7:21 PMscrenshaw
10/29/2021, 7:22 PMbattk
10/29/2021, 7:30 PMscrenshaw
10/29/2021, 7:30 PMbattk
10/29/2021, 7:31 PMbattk
10/29/2021, 7:31 PMscrenshaw
10/29/2021, 7:36 PMvar restletUrl = url.resolveScript({
scriptId: 'customscript_ad_rl_query',
deploymentId: 'customdeploy_ad_rl_query',
returnExternalUrl: false
});
var response = <http://https.post|https.post>({
url: restletUrl,
body: context.request.body,
headers: {Authorization: headers.Authorization}
});
battk
10/29/2021, 7:36 PMscrenshaw
10/29/2021, 7:37 PMbattk
10/29/2021, 7:37 PMbattk
10/29/2021, 7:37 PMbattk
10/29/2021, 7:38 PMbattk
10/29/2021, 7:38 PMscrenshaw
10/29/2021, 7:39 PMscrenshaw
10/29/2021, 7:39 PMbattk
10/29/2021, 7:40 PMbattk
10/29/2021, 7:41 PMscrenshaw
10/29/2021, 7:41 PMbattk
10/29/2021, 7:41 PMbattk
10/29/2021, 7:42 PMbattk
10/29/2021, 7:42 PMscrenshaw
10/29/2021, 7:42 PMbattk
10/29/2021, 7:45 PMbattk
10/29/2021, 7:46 PMscrenshaw
10/29/2021, 7:46 PMbattk
10/29/2021, 7:47 PMscrenshaw
10/29/2021, 7:47 PMbattk
10/29/2021, 7:47 PMscrenshaw
10/29/2021, 7:49 PMbattk
10/29/2021, 7:49 PMbattk
10/29/2021, 7:50 PMbattk
10/29/2021, 7:50 PMbattk
10/29/2021, 7:51 PMscrenshaw
10/29/2021, 7:52 PMbattk
10/29/2021, 7:52 PMbattk
10/29/2021, 7:52 PMbattk
10/29/2021, 7:52 PMbattk
10/29/2021, 7:55 PMbattk
10/29/2021, 7:55 PMscrenshaw
10/29/2021, 7:58 PMscrenshaw
10/29/2021, 8:00 PMbattk
10/29/2021, 8:07 PMscrenshaw
10/29/2021, 8:12 PMReferenceError: fetch is not defined [at Object.onRequest
any idea why?
fetch('https://${AccountId}.<http://app.netsuite.com/app/site/hosting/restlet.nl?script=1818&deploy=1')|app.netsuite.com/app/site/hosting/restlet.nl?script=1818&deploy=1')>
.then(response => {
log.debug("response", response);
return response.json()
}
)
.then(data => log.debug(data));
battk
10/29/2021, 8:17 PMstalbert
10/29/2021, 11:02 PMfkrauthan
10/29/2021, 11:11 PMurl.resolveScript
and a simple http client without any authentication setting works as it should use your current user sessionscrenshaw
10/30/2021, 12:31 AMscrenshaw
10/30/2021, 12:31 AM