Shelby Owens
08/12/2025, 3:22 PMCeligo AI
08/12/2025, 3:23 PMAI generated answer (using internal Slack threads):To call a Suitelet from a Client Script without opening the Suitelet in a new window, you can use the
https module's get.promise or post.promise methods. This allows you to make a GET or POST request to the Suitelet URL, and handle the response asynchronously.
Here's a basic example of how you can do this:
javascript
var suiteletURL = url.resolveScript({
scriptId: 'customscript_my_suitelet',
deploymentId: 'customdeploy_my_suitelet',
returnExternalUrl: true
});
https.get.promise({
url: suiteletURL
}).then(function(response){
var responseBody = JSON.parse(response.body);
// handle response here
}).catch(function onRejected(reason){
log.error({
title: 'GET failed',
details: reason
});
});
In this example, customscript_my_suitelet and customdeploy_my_suitelet should be replaced with your Suitelet's Script ID and Deployment ID, respectively. The returnExternalUrl parameter is set to true to get the external URL of the Suitelet.
The https.get.promise method returns a Promise that resolves with the response from the Suitelet. You can then handle the response in the then method. If the GET request fails for any reason, the catch method will be called with the reason for the failure.
Please note that this method will only work if your Suitelet is set to be Available Without Login. If it's not, you'll need to include the appropriate authentication in your request.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
08/12/2025, 3:23 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842108786
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835199058
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829367101
Celigo AI
08/12/2025, 3:23 PM