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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to stop duplication of rows in Interactive Grid

Muhammad RafeyAug 1 2022

I'm trying to parse JSON data into Interactive Grid through JavaScript for which I've used the following code, but it causes duplication of rows
Code:
var widget = apex.region('multiclauses').widget();
var grid = widget.interactiveGrid('getViews','grid');
var model = grid.model;
var myJSONString = $v("G_STANDARD_AGENDA_JSON");
var myObject = JSON.parse(myJSONString);
model.clearData();

for ( var i = 0; i < myObject.length; i++)
{
var obj = myObject[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, 'nd_description', obj.desc);
model.setValue(myNewRecord, 'UW_CLAUSE_ID', obj.Clause_Code);
};
Result:
Capture.PNG How should I prevent duplication? Kindly Help

Comments
Post Details
Added on Aug 1 2022
0 comments
214 views