Hello,
Is it possible to have a Suitelet call itself with different parameters?
I did find a SuiteAnswer on this (#72197) so I think I should be able to but I cannot get it to work.
I am using this code the first time I call the Suitelet:
const suiteLetUrl = url.resolveScript({
scriptId: 'customscript_cry_acs_sl_item_update', // changed to CRY version, JudyP 6/18/24
deploymentId: 'customdeploy_cry_acs_sl_item_update',
returnExternalUrl: false,
params: {
'custscript_acs_item_id': newItemId,
'custscript_acs_item_type': newItemType,
'custscript_cry_quantity_change': qtyDiff
}
});
log.debug('Suitelet URL',suiteLetUrl);
https.get({
url: suiteLetUrl
});
Then, in the same Suitelet, I want to call it again for a different Item.
If I use the same format as above I cannot get the URL to resolve.
I also tried this:
var response = https.requestSuitelet({
scriptId: 'customscript_cry_acs_sl_item_update', // changed to CRY version, JudyP 6/18/24
deploymentId: 'customdeploy_cry_acs_sl_item_update',
external: false,
urlParams: {
'custscript_acs_item_id': arrSKUs[li],
'custscript_acs_item_type': linkRec.type,
'custscript_cry_quantity_change': qtyChange
}
});
I am not getting any errors in the log file for this method, but the script is also not running again. That is, I'm not seeing any log messages that would appear when the script first starts running.
As always, grateful for any advice you can give!
Thanks,
Judy