Apex 18.2
- I have a region(order_detail) which has a column(qty) and a static id of "order_detail".
- a button that should assign value of "9" for "qty" field of the "current record" or "selected record" as per you call it(It's the last record the user navigated to) when it's clicked.
I have created a dynamic action executes the following javascript code when the button is clicked,
var widget = apex.region('order_detail').widget();
var grid = widget.interactiveGrid('getViews','grid');
var model = grid.model;
var x = model.getSelectedRecords();
var b = model.getRecordId(x);
model.setRecordValue(b, "QTY", 9);
when I run the page it shows 2 errors,
1- Unchecked runtime.lastError: The message port closed before a response was received.
2-
Uncaught TypeError: Cannot read property '0' of null
at Object._getIdentity (interactiveGrid.min.js?v=18.2.0.00.12:2)
at Object.setValue (interactiveGrid.min.js?v=18.2.0.00.12:1)
at Object.setRecordValue (interactiveGrid.min.js?v=18.2.0.00.12:1)
at Object.javascriptFunction (f?p=11561:8:110771644048721::::::445)
at Object.da.doAction (desktop_all.min.js?v=18.2.0.00.12:23)
at Object.da.doActions (desktop_all.min.js?v=18.2.0.00.12:23)
at HTMLButtonElement.<anonymous> (desktop_all.min.js?v=18.2.0.00.12:23)
at Function.each (desktop_all.min.js?v=18.2.0.00.12:2)
at r.fn.init.each (desktop_all.min.js?v=18.2.0.00.12:2)
at Object.da.actions (desktop_all.min.js?v=18.2.0.00.12:23)
Edited:
Workspace= MY_WS
user= forhelp
password= forhelppwd
app= POS
page= 8