-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec_button_es.js
38 lines (38 loc) · 1.07 KB
/
spec_button_es.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
define([], function(){
/**
*
* @NApiVersion 2.x
* @NScriptType UserEventScript
* @appliedtorecord lotnumberedassemblyitem
*/
var exports = {};
/**
* <code>beforeLoad</code> event handler
*
* @gov 0
*
* @param context
* {Object}
* @param context.newRecord
* {record} the new record being loaded
* @param context.type
* {UserEventType} the action that triggered this event
* @param context.form
* {form} The current UI form
*
* @return {void}
*
* @static
* @function beforeLoad
*/
function beforeLoad(context) {
context.form.addButton({ //adds button to UI that executes function "onButtonClick" from CS program
id: "custpage_printspec",
label: "Print Spec",
functionName: "onButtonClick"
});
context.form.clientScriptModulePath = "SuiteScripts/SpecButton/spec_button_click_cs.js"; //sets path to CS program for spec button
}
exports.beforeLoad = beforeLoad;
return exports;
});