ericbirdsall
09/30/2020, 5:00 PM/**
* @NScriptName
* @NApiVersion 2.1
* @NScriptType UserEventScript
*
* This script does something when a picking ticket is printed...
*
*/
define([], function () {
/**
* @param context {Object}
* @param context.type {UserEventType} Trigger type
* @param context.form {Form} Current form
*
* @function beforeLoad
*/
function beforeLoad(context) {
if (context.type == context.UserEventTypes.PRINT) {
var record = context.newRecord;
var queryString = record.getValue({
fieldId: 'entryformquerystring'
});
if (queryString.includes('pt=T')) {
// Do something when a picking ticket is printed...
}
}
}
return {
beforeLoad: beforeLoad
}
});