Corey Schwoebel
12/27/2024, 2:52 PMCorey Schwoebel
12/27/2024, 2:52 PM/**
*@NApiVersion 2.1
*@NScriptType UserEventScript
*/
define(['N/url', 'N/https'],
function (url, https) {
function afterSubmit(context) {
const suiteletUrl = url.resolveScript({
scriptId: 'customscript_komet_address_update_sl',
deploymentId: 'customdeploy1'
});
const domain = url.resolveDomain({
hostType: url.HostType.APPLICATION
});
const payload = {
testKey: 'testVal'
}
let response = <http://https.post|https.post>({
url: 'https://' + domain + suiteletUrl,
body: JSON.stringify(payload),
headers: { 'Content-Type': 'application/json' }
});
log.debug({ title: 'suiteletUrl', details: 'https://' + domain + suiteletUrl });
log.debug({
title: 'Suitelet Response',
details: response.body
});
}
return {
afterSubmit: afterSubmit
};
}
);
Nadav Julius
12/27/2024, 2:55 PMLuiz Morais
12/27/2024, 3:26 PMCorey Schwoebel
12/27/2024, 4:21 PM