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.


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!