[Suitelet calling another suitelet] Aim: Calling ...
# suitescript
d
[Suitelet calling another suitelet] Aim: Calling a suitelet from another suitelet Error: Not fully qualified Url. Invalid url What I did:
var suiteUrl = url.resolveScript({scriptId: 'customscriptxx', deploymentId: 'customdeploy1', returnExternalUrl: false});
<http://https.post|https.post>({url: suiteUrl, body: {param1: value1}})
When I logged the url, is starts with '/app/....'
n
Have you tried with returnExternalUrl = true?
d
I just try it. It doesnt work.
n
@Damree Ilyaad Maybe try:
var initialURL= url.resolveScript({scriptId:'customscriptxx',deploymentId:'customdeploy1',returnExternalUrl:false});
var domain = url.resolveDomain({
hostType: url.HostType.APPLICATION,
accountId: runtime.accountId
});
var suiteURL = 'https://' + domain + initialURL;
b
basic problem will be that the server that runs your suitelet does not have the cookie required to access internal urls
a suitelet will only be able to make a successful request to another suitelet if that other suitelet is available externally
👍 1
r
Just a thought: but why are you calling a suitelet to another suitelet? Normally if you need something done you would call a SS or a MR to do something right unless its a existing SL that you want to make use of it
d
Issue solved. My clientscript was calling the suitelet. Instead of trying calling my 2nd suitelet from the 1st suitelet, i called my 2nd suitelet from my clientscript after executing the first suitelet.
👍 1
r
👍