bdebazelaire
03/26/2021, 2:14 PMSandii
03/26/2021, 2:23 PMbattk
03/26/2021, 3:40 PMbdebazelaire
03/26/2021, 4:49 PMbdebazelaire
03/26/2021, 4:49 PM/**
*@NApiVersion 2.x
*@NScriptType UserEventScript
*/
define(['N/record', 'N/currentRecord'],
function(record, currentRecord) {
function beforeLoad(context) {
if(context.type != context.UserEventType.VIEW)
{
var newSoRecord = context.newRecord;
context.form.clientScriptFileId = 6416;
var record = currentRecord.get();
var matercost = record.getValue({
fieldId:'trandate'
});
context.form.addButton({
id: "custpage_calculatecommission",
label: "Calculate Shipping",
functionName: "calculatecommission("+ matercost +")"
});
}
}
return {
beforeLoad: beforeLoad,
};
}
);
battk
03/26/2021, 4:51 PMbattk
03/26/2021, 4:51 PMbattk
03/26/2021, 4:52 PMSandii
03/26/2021, 4:52 PMbattk
03/26/2021, 4:52 PMbdebazelaire
03/26/2021, 4:57 PMSandii
03/26/2021, 4:59 PMbattk
03/26/2021, 5:00 PMbdebazelaire
03/26/2021, 5:07 PMbattk
03/26/2021, 5:10 PMbdebazelaire
03/26/2021, 5:18 PMbattk
03/26/2021, 5:21 PMbattk
03/26/2021, 5:21 PMbdebazelaire
03/26/2021, 5:31 PMbattk
03/26/2021, 5:36 PMbattk
03/26/2021, 5:36 PMbattk
03/26/2021, 5:38 PMbattk
03/26/2021, 5:41 PMbdebazelaire
03/26/2021, 5:46 PMbdebazelaire
03/26/2021, 5:46 PMdefine(['N/record'],
function(record) {
function beforeLoad(context) {
if(context.type != context.UserEventType.VIEW)
{
var newSoRecord = context.newRecord;
var test = newSoRecord.getValue({
fieldId: 'trandate'
});
log.debug({title:'ServerSide',details:test});
context.form.clientScriptFileId = 6416;
context.form.addButton({
id: "custpage_calculateShippingRate",
label: "Calculate Shipping",
functionName: "calculatecommission("+ test +")"
});
}
}
return {
beforeLoad: beforeLoad,
};
}
);
battk
03/26/2021, 5:47 PMbattk
03/26/2021, 5:48 PMbdebazelaire
03/26/2021, 6:03 PMbattk
03/26/2021, 6:07 PMbdebazelaire
03/26/2021, 6:30 PMSandii
03/26/2021, 6:41 PM