al3xicon
12/30/2016, 2:42 PM/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
* @NModuleScope SameAccount
*/
define([],
function() {
/**
* Function definition to be triggered before record is loaded.
*
* @param {Object} scriptContext
* @param {Record} scriptContext.newRecord - New record
* @param {string} scriptContext.type - Trigger type
* @param {Form} scriptContext.form - Current form
* @Since 2015.2
*/
function beforeLoad(scriptContext) {
scriptContext.form.clientScriptFieldId = 1753729; // client script field internal ID
scriptContext.form.addButton({
id: 'custpage_getstickercsv',
label: 'Download CSV for Stickers',
functionName: 'downloadStickerCSV'
});
}
return {
beforeLoad: beforeLoad
};
});