I have an interactive grid with custom action defined on it. What I am trying to do is loop through the grid, grabbing all the selected records, then loop through the records and update a single database field for each record, setting it to 0.
I am using the following code to loop through the records, grabbing record ID:
view=apex.region("myGrid").widget().interactiveGrid("getViews","grid");
if (view.supports.edit)
{
model=view.model;
records=view.getSelectedRecords();
if(records.length>0)
{
for(i=0;i< records.length; i++)
{
$record_id= model.getValue(records[i], "RECORD_ID");
//update the database here UPDATE TABLE1 SET Flag=0 WHERE RECORD_ID=$record_id
}
}
}
what is the best way to perform an update from here?