t_gdb
09/23/2024, 8:47 AMconst afterSubmit = (scriptContext) => {
try {
if (scriptContext.type === scriptContext.UserEventType.CREATE || scriptContext.type === scriptContext.UserEventType.EDIT) {
var opportunityId = scriptContext.newRecord.getValue({fieldId: 'opportunity'});
if (!opportunityId) {return}
log.debug('This Opportunity will be updated. ID:', opportunityId);
var requestOptions = {
scriptId: 'customscript_tg_sl_load_opp_from_quo', // Replace with your Suitelet script ID
deploymentId: 'customdeploy1', // Replace with your Suitelet deployment ID
urlParams: {
opportunityId: opportunityId // Passing the Opportunity ID as a parameter
}
};
// Use the promise-based method to call the Suitelet
https.requestSuitelet.promise(requestOptions)
//https.requestSuitelet(requestOptions)
}
} catch (e) {
log.error('Error in afterSubmit', e + e.stack);
}
}
battk
09/23/2024, 8:55 AMbattk
09/23/2024, 8:55 AMbattk
09/23/2024, 8:56 AMbattk
09/23/2024, 8:56 AMt_gdb
09/23/2024, 9:20 AM