I have defined 2 variables in Page> Function and Global Variable Declaration attribute,
var grid;
var model;
and in "Execute when page loads" attribute,
grid = apex.region('REQUISITION_DTL').widget().interactiveGrid('getViews','grid');
model = grid.model;
- There is a classic report with a modified Cards template(only a substitution called #REPORT_ATTRIBUTES# is added) which has an on click(clicks on an image) dynamic action to execute a function called addItem that's defined in Page> Function and Global Variable Declaration attribute,
function addItem (item){
//insert new record on a model
console.log(model);
var myNewRecordId = model.insertNewRecord();
var myNewRecord = model.getRecord(myNewRecordId);
model.setValue(myNewRecord,"ITEM_ID",{d: item.name, v: item.id.toString()});
}
When I click an image in the classic report I get the following error,

- "REQUISITION_DTL" edit attribute is enabled.
- When I add
grid = apex.region('REQUISITION_DTL').widget().interactiveGrid('getViews','grid');
model = grid.model;
"inside" the dynamic action javascript code, the record is added with no problems at all.
grid = apex.region('REQUISITION_DTL').widget().interactiveGrid('getViews','grid');
model = grid.model;
var itemData = $(this.triggeringElement).data();
addItem(itemData);
Workspace= MY_WS
user= forhelp
password= forhelppwd
Page 4
Application 11561 - POS