Discussions

Check out Oracle NetSuite upcoming events and conferences here
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Update your Profile with your Support type to get your Support Type badge.
Expand your NetSuite knowledge by joining our Ask A Guru Live sessions. RSVP on this event now.
Community Poll: What sort of content would you like to see more of?

Calling a RESTlet from a Suitelet.

edited Nov 21, 2023 3:26PM in Ask A Guru 3 comments

UPDATE: Answer below, you can do this with the requestReslet() method.

I am trying to execute a GET action on a Suitelet in the same account. I've done this in the past successfully, but for some reason the same code I used before doesn't work now.

This is my test code:

        var suiteletURL = url.resolveScript({
            scriptId: 'customscript_rl_test',
            deploymentId: 'customdeploy_rl_test',
            returnExternalUrl: false
        });
    
        var response = https.get({url: suiteletURL});

And this is what NetSuite returns:

SS_INVALID_URL
{
   type: "error.SuiteScriptError",
   name: "SSS_INVALID_URL",
   message: "The URL must be a fully qualified HTTPS URL.",
   id: null,
   stack: [
      "createError(N/error)",
      "execute(/SuiteScripts/CSG_SS_Test.js:16)",
      "createError(N/error)"
   ],
   cause: {
      name: "SSS_INVALID_URL",
      message: "The URL must be a fully qualified HTTPS URL."
   },
   notifyOff: false,
   userFacing: true
}

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!

Leaderboard

Community Whiz

Quarter 2 ((Apr-Jun 2024) )

This Week's Leaders

This Month's Leaders

All Time Leaders