How I can call suitelet from suitelet ?
# ask-stanley-ai
j
How I can call suitelet from suitelet ?
c
AI generated answer (using internal Slack threads):
To call one Suitelet from another Suitelet in SuiteScript 1.0, you can use the
nlapiRequestURL
function in combination with
nlapiResolveURL
. However,
nlapiResolveURL
only gives you the partial URL for the Suitelet, so you will need to add the domain to it. Here is an example:
Copy code
javascript
var url = '<https://system.na1.netsuite.com>' + nlapiResolveURL('SUITELET', 'customscript_mark_truck_shipped', 'customdeploy_mark_truck_shipped') + '&truck=' + cont;
var response = nlapiRequestURL(url);
Please replace
'<https://system.na1.netsuite.com>'
with your NetSuite domain. Please note that when you request a Suitelet, you do not have access to the functions in that Suitelet in your client script. Your Suitelet becomes a REST endpoint where you just send it data and it does its thing and sends you a result. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.858656883
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.854418576
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852898836
Please provide your feedback on this answer.