Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

IG error: insert not allowed for new record

Eslam_ElbyalyMar 30 2019 — edited Mar 31 2019

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,

pastedImage_0.png

- "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

Comments
Post Details
Added on Mar 30 2019
5 comments
961 views