RE: Login Page when Requesting SuiteLet from script

Hello everyone!

I have two separate uses cases where I need to call a SuiteLet from a script, in one case it’s a Client Script and the other is a User Event script. In both cases after requesting the SuiteLet resource the response is the NetSuite Login page (i.e., authentication issue).

What I’ve checked:

  1. SuiteLet is Released
  2. SuiteLet audience is set correctly
  3. SuiteLet is NOT configured to be available without login (this shouldn’t be necessary)
  4. UE script is running as Administrator (I’m also testing as Administrator)

Here’s the code requesting the SuiteLet (POC-level code, final code will use url.resolveScript, etc.)

const response = https.get({
url: 'https://0000000-sb2.app.netsuite.com/app/site/hosting/scriptlet.nl?script=2708&deploy=1'
})

That code results in the following response (truncated to keep post short):


<!doctype html> <html> <head> <title>NetSuite Login</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name...

When I request the SuiteLet in the browser using the same URL it works fine, but when requested from UE script it results in the login page.

I know I’ve successfully done something similar in the past, but I can’t remember what was needed to make this work.

Anyone have any ideas for me to check?

Steveklett Rookie Asked on November 22, 2024 in SuiteScript.
Add Comment
1 Answers

Have you tried checking the “Available without login” checkbox on the script file

RE: Login Page when Requesting SuiteLet from script

Rookie Answered on November 29, 2024.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.