Paul_s
08/31/2021, 12:21 PMUmar Naeem
08/31/2021, 12:22 PMPaul_s
08/31/2021, 12:23 PMUmar Naeem
08/31/2021, 12:24 PMUmar Naeem
08/31/2021, 12:24 PMPaul_s
08/31/2021, 12:25 PMUmar Naeem
08/31/2021, 12:25 PMUmar Naeem
08/31/2021, 12:27 PMdefine(['N/currentRecord'], _function_(_currentRecord_) {
_function_ customButtonHandler() {
_var_ recordObj = _currentRecord_.get();
}
return {
customButtonHandler: customButtonHandler
}
})
Note: If you are in edit mode, this will return a dynamic record. means you can access all sublists and can do everything that u can in a clientscript entrypoint. In View mode it will only return a readonly static object.Paul_s
08/31/2021, 12:32 PMUmar Naeem
08/31/2021, 12:35 PMUmar Naeem
08/31/2021, 12:35 PMPaul_s
08/31/2021, 12:39 PMUmar Naeem
08/31/2021, 12:40 PMUmar Naeem
08/31/2021, 12:40 PMPaul_s
08/31/2021, 12:41 PMif(scriptContext.type != scriptContext.UserEventType.VIEW) {
var list = scriptContext.form.getSublist('item');
list.addButton({
id: 'custpage_add_po_items',
label: 'Add PO Items',
functionName: 'addPOItems'
});
}
is the UE, in a beforeloadUmar Naeem
08/31/2021, 12:42 PMPaul_s
08/31/2021, 12:43 PMPaul_s
08/31/2021, 12:43 PMdefine(['N/record', 'N/search'],
function(record, search) {
function addPOItems(){
console.log('test');
}
return {
addPOItems: addPOItems
};
)};
Umar Naeem
08/31/2021, 12:44 PMUmar Naeem
08/31/2021, 12:46 PM_scriptContext_.form.clientScriptFileId = clientScriptFileInternalId;
Paul_s
08/31/2021, 12:48 PMUmar Naeem
08/31/2021, 12:50 PM