irurzo
02/28/2023, 5:52 PMTristan Day
02/28/2023, 6:34 PMjen
02/28/2023, 8:46 PMbattk
02/28/2023, 9:36 PMbattk
02/28/2023, 9:37 PMirurzo
02/28/2023, 9:39 PM// redirect.toSuitelet only works on UI, not when doing bulk transactions
if (runtime.executionContext === 'USERINTERFACE') {
callSuitelet({ id, type, dataToSend });
}
if (runtime.executionContext === 'USEREVENT') {
editOrderStatus({ id, type, dataToSend });
}
Apparently when i did my tests, when bulk processing the context was USERINTERFACE but now the context is USEREVENT. Now i just commented that out and let the callSuitelet function but on my tests for some reason the callSuitelet is not triggering the suitelet, on the logs of the suitelet I have a function right at the beginning and this is not being printed
const callSuitelet = ({ id, type, dataToSend }) => {
const fn = 'callSuitelet';
log.debug({ title: `${fn}`, details: 'start...' });
try {
// call to suitelet to trigger UE transaction trigger, UE cant chain other UEs
const params = {
id,
type,
externalid: dataToSend.externalId,
};
log.debug({ title: params, details: params });
redirect.toSuitelet({
scriptId: 'customscript_bit_su_he',
deploymentId: 'customdeploy_bit_su_he',
parameters: params,
});
} catch (error) {
log.error({ title: `Error: ${fn}`, details: error });
}
};
battk
02/28/2023, 9:44 PMirurzo
02/28/2023, 9:47 PMirurzo
02/28/2023, 9:48 PMbattk
02/28/2023, 10:03 PM