I have a script that I want to execute when a line from an order is updated and also when the order is saved.
I saved the script on a SuiteLet. When I try to execute the script from the ClientScript, it seems it is not called. I reduced the Suitelet to a log line to check if the flow works.
From the ClientScript, the lines that call the Suitelet is
...
const { body } = https.requestSuitelet({
scriptId: 'customscript1234',
deploymentId: 'customdeploy1234',
body: {
recordId: currentRecordObj.id,
recordType: currentRecordObj.type
}
});
log.debug('response.body: ', body);
...
The Suitelet
/**
* @NApiVersion 2.1
* @NScriptType Suitelet
* @NModuleScope SameAccount
*/
define(['N/log'], (log) => {
const onRequest = (context) => {
log.debug({ title: 'START DEBUG' });
};
return { onRequest };
});
The ClientScript works because it executes the code, and the logs are printed. But it seems it doesn’t call the Suitelet