ijordan
04/07/2021, 6:13 PMGSWes
04/07/2021, 7:08 PMfunction handleBeforeLoad(context) {
if (context.type != 'view') { return false; }
enums.buttonArray.forEach(button => {
context.form.addButton(button);
})
context.form.clientScriptModulePath = "SuiteScripts/sr_custom_button_press_cl.js";
}
Here’s the enum.js
define([], function () {
const exports = {}
const buttonArray = [
{
id: 'custpage_btn_spcl',
label: 'Special',
functionName: "greet"
},
{
id: 'custpage_btn_ord',
label: 'Ordinary',
functionName: "greet"
}
]
exports.buttonArray = buttonArray
return exports
});
Here’s the function that is supposed to run when either of the two buttons are pressed.
define([], function () {
/**
* @NApiVersion 2.x
* @author Wes
*/
var exports = {};
function greet() {
log.debug('My Greeting', 'Hello world')
console.log('Hello world');
alert('Hello world')
}
exports.greet = greet;
return exports;
});
Ogabeg
04/07/2021, 7:53 PMEric Shouler
04/07/2021, 8:43 PMPong Bautista
04/07/2021, 8:45 PMPhillip
04/07/2021, 10:55 PMKevinJ of Kansas
04/07/2021, 11:03 PMKevinJ of Kansas
04/07/2021, 11:04 PMKevinJ of Kansas
04/07/2021, 11:05 PMmichoel
04/07/2021, 11:05 PMJBL
04/08/2021, 6:25 AMLRG
04/08/2021, 8:07 AMmofo
04/08/2021, 8:57 AMAlan Fitch
04/08/2021, 2:42 PMMichael McNamara
04/08/2021, 3:06 PMRamanand
04/08/2021, 3:45 PMAdam Webber
04/08/2021, 4:05 PMAdam Webber
04/08/2021, 4:06 PMRich Keller, CSCP
04/08/2021, 4:14 PMRamanand
04/08/2021, 4:15 PMAdam Webber
04/08/2021, 4:20 PMAdam Webber
04/08/2021, 4:22 PMSciuridae54696d
04/08/2021, 4:29 PMAmber Thompson
04/08/2021, 5:03 PMAmtoj
04/08/2021, 5:49 PMSteven
04/08/2021, 6:32 PMEric Roelofs
04/08/2021, 6:52 PMAmanda Rosiak
04/08/2021, 8:31 PMgeorge085
04/08/2021, 11:30 PMKevinJ of Kansas
04/09/2021, 12:07 AM