erictgrubaugh
11/10/2020, 7:38 PMZoran Roncevic
11/10/2020, 7:52 PMerictgrubaugh
11/10/2020, 7:53 PMSim Greenbaum
11/10/2020, 7:55 PMSim Greenbaum
11/10/2020, 7:58 PM/**
*@NApiVersion 2.x
*@NScriptType ClientScript
*/
define(['N/record'], function(record) {
function printMeNow() {
var id = = record.id;
show_preview(document.forms['main_form'].orderid.value, id); //Standard Print Button on Item Fulfillment
print_shipping_label(document.forms['main_form'].orderid.value, id); //Standard Print Label Button on Item Fulfillment
window.open('/app/accounting/print/barcodeprinter.nl?trantype=itemfulfillment&tranid=' + id); // Standard Print Item Labels Button on Item Fulfillment
}
}
Zoran Roncevic
11/10/2020, 7:58 PMSandii
11/10/2020, 8:10 PMalien4u
11/10/2020, 8:14 PMSandii
11/10/2020, 8:14 PMZoran Roncevic
11/10/2020, 8:28 PMfunction beforeLoad(scriptContext) {
var form = scriptContext.form;
form.clientScriptModulePath = "./xxx_bstmt_cs.js";
if (scriptContext.type == scriptContext.UserEventType.VIEW) {
form.addButton({
id : "custpage_submit_parser_button",
label : 'Parse',
functionName : 'submit_parser()'
});
Zoran Roncevic
11/10/2020, 8:29 PMreturn {
pageInit: pageInit,
submit_parser : _submit_parser,
submit_payments : _submit_payments,
submit_lookup : _submit_lookup
// fieldChanged: fieldChanged,
// postSourcing: postSourcing,
// sublistChanged: sublistChanged,
// lineInit: lineInit,
// validateField: validateField,
// validateLine: validateLine,
// validateInsert: validateInsert,
// validateDelete: validateDelete,
// saveRecord: saveRecord
};
Sim Greenbaum
11/10/2020, 8:59 PMSandii
11/10/2020, 9:25 PMSandii
11/10/2020, 9:28 PMcontext.form.addButton({
id: 'custpage_clickme',
label: 'Click Me',
functionName: `(() => {
var id = context.newRecord.id;
show_preview(document.forms['main_form'].orderid.value, id); //Standard Print Button on Item Fulfillment
print_shipping_label(document.forms['main_form'].orderid.value, id); //Standard Print Label Button on Item Fulfillment
window.open('/app/accounting/print/barcodeprinter.nl?trantype=itemfulfillment&tranid=' + id); // Standard Print Item Labels Button on Item Fulfillment
})()`
});
should be really close to what you need on beforeLoad UserEvent (assuming 2.1 bc of syntax)Sim Greenbaum
11/10/2020, 9:31 PMSim Greenbaum
11/10/2020, 9:41 PMSandii
11/10/2020, 10:08 PMcontext.type
against context.UserEventType.CREATE
at beginning of script before adding the button.Zoran Roncevic
11/11/2020, 7:41 AM