var SEARCHMODULE;
/**
*@NApiVersion 2.x
*@NModuleScope Public
*@NScriptType ClientScript
*/
define(['N/search'], runClientscript);
function runClientscript(search){
SEARCHMODULE = search;
//*********** HELPER FUNCTIONS ***********
function lineInit(context) {
//SEARCHMODULE.load(123);
context.currentRecord;
context.sublistId;
alert("lineInit Triggered!");
return;
}
function pageInit(context) {
context.currentRecord;
context.mode;
alert("pageInit Triggered!");
return;
}
function postSourcing(context) {
context.currentRecord;
context.sublistId;
context.fieldId;
alert("postSourcing Triggered!");
return;
}
function saveRecord(context) {
context.currentRecord;
alert("saveRecord Triggered!");
return true; //Return true if you want to continue saving the record.
}
function sublistChanged(context) {
context.currentRecord;
context.sublistId;
alert("sublistChanged Triggered!");
}
function validateDelete(context) {
context.currentRecord;
context.sublistId;
alert("validateDelete Triggered!");
return true; //Return true if the line deletion is valid.
}
function validateField(context) {
context.currentRecord;
context.sublistId;
context.fieldId;
context.line;
context.column;
alert("validateField Triggered!");
return true; //Return true to continue with the change.
}
function validateInsert(context) {
context.currentRecord;
context.sublistId;
alert("validateInsert Triggered!");
return true; //Return true if the line insertion is valid.
}
function validateLine(context) {
context.currentRecord;
context.sublistId;
alert("validateLine Triggered!");
return true; //Return true if the line is valid.
}
function fieldChanged(context) {
context.currentRecord;
context.sublistId;
context.fieldId;
context.line;
context.column;
alert("fieldChanged Triggered!");
return;
}
var returnObj = {};
returnObj.lineInit = lineInit;
returnObj.pageInit = pageInit;
returnObj.postSourcing = postSourcing;
returnObj.saveRecord = saveRecord;
returnObj.sublistChanged = sublistChanged;
returnObj.validateDelete = validateDelete;
returnObj.validateField = validateField;
returnObj.validateInsert = validateInsert;
returnObj.validateLine = validateLine;
returnObj.fieldChanged = fieldChanged;
return returnObj;
}