David
08/11/2020, 3:14 AMbattk
08/11/2020, 3:22 AMbattk
08/11/2020, 3:24 AMDavid
08/11/2020, 3:32 AM/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
* @NModuleScope SameAccount
*/
define(['N/https'],
function (https) {
/**
* Function definition to be triggered before record is loaded.
*
* @param {Object} scriptContext
* @param {Record} scriptContext.newRecord - New record
* @param {Record} scriptContext.oldRecord - Old record
* @param {string} scriptContext.type - Trigger type
* @Since 2015.2
*/
function afterSubmit(scriptContext) {
var headers1 = [];
headers1['Content-Type'] = 'application/json';
var body1 = JSON.stringify({
name: 'John',
email:<mailto:'john@example.com|'john@example.com>',
job: 'developer'
});
var postRequest = <http://https.post|https.post>({
url: '<https://third.party.server.com/api/>',
body: body1,
headers: headers1
}); // The body is left empty by the time the request is received at the 3rd party server (per logs on said server)
}
return {
afterSubmit: afterSubmit
};
}
);
battk
08/11/2020, 3:43 AMbattk
08/11/2020, 3:44 AMbattk
08/11/2020, 3:44 AMDavid
08/11/2020, 4:15 AMdarrenhillconsulting
08/11/2020, 6:28 PMdarrenhillconsulting
08/11/2020, 6:28 PM