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!

Javascript Insert Record into Interactive Grid <column> must have some value

BaonergesAug 13 2019 — edited Aug 16 2019

Hi Everyone,

I am trying to use javascript to insert 10 rows into my interactive grid when P3_ITEM_CODE changes. Here is my code:

var widget = apex.region('InkBreakdown').widget();

var grid = widget.interactiveGrid('getViews','grid');

var model = grid.model;

var newItem = apex.item("P3_ITEM_CODE").getValue()

model.clearData();

var i;

for (i = 1; i <= 10; i++) {

//insert new record on a model

var myNewRecordId = model.insertNewRecord();

//get the new record

var myNewRecord = model.getRecord(myNewRecordId);

//update record values

model.setValue(myNewRecord, 'ITEM\_CODE', newItem);

model.setValue(myNewRecord, 'STATION', i);

}

When I press save on the IG, this is what I get.

pastedImage_1.png

pastedImage_2.png

It does not complain about the ITEM_CODE column at all, just about the STATION column. If I remove line 16 of the code above and I type in numbers 1 through 10 manually in each row that was added by the javascript function, it works. Any ideas why it does not like those numbers?

Thanks for any help!

This post has been answered by Baonerges on Aug 16 2019
Jump to Answer
Comments
Post Details
Added on Aug 13 2019
1 comment
1,360 views