Hunter Jacobs
11/28/2023, 5:18 PMSam-I-Am
11/28/2023, 5:24 PMHunter Jacobs
11/28/2023, 5:26 PMSam-I-Am
11/28/2023, 5:29 PMHunter Jacobs
11/28/2023, 5:32 PMHunter Jacobs
11/28/2023, 5:32 PMSam-I-Am
11/28/2023, 5:36 PMHunter Jacobs
11/28/2023, 7:58 PMSam-I-Am
11/28/2023, 8:41 PMHunter Jacobs
11/28/2023, 8:43 PMHunter Jacobs
11/28/2023, 8:43 PMHunter Jacobs
11/28/2023, 8:46 PMSam-I-Am
11/29/2023, 9:26 PMHunter Jacobs
12/20/2023, 8:01 PM/**
* @NApiVersion 2.1
* @NScriptType UserEventScript
*/
define(['N/record', 'N/log'], function(record, log) {
function beforeLoad(context) {
if (context.type !== context.UserEventType.CREATE) {
return;
}
try {
var newRecord = context.newRecord;
if (newRecord.type === 'emailtemplate') {
newRecord.setValue({
fieldId: 'isprivate',
value: true
});
}
} catch (e) {
log.error({
title: 'Error setting isPrivate on Email Template',
details: e.toString()
});
}
}
return {
beforeLoad: beforeLoad
};
});