1
votes

Apex 19.1

A Dynamic Action on a button on an interactive grid sets the status column of the selected rows to 1 when clicked. This shows as a changed row (little blue triangle in the corner). On Save there is no error but NULL is written to the database (the original value is 0). The grid is based on a joined view with ROWID as key.

The solution for this is taken from: Button to change selected records

Like the OP I could not get the other solutions to work and am not familiar enough with javascript to fix the issues.

This is the code that changes the value in the column. :

var g = apex.region('myIG').widget().interactiveGrid('getViews','grid');  
var r = g.getSelectedRecords();  
for(i = 0; i < r.length; i++) {   
g.model.setValue(r[i], 'myColumn', 1);
}

I would expect the new value of 1 to be written not NULL. A new / NULL value is being sent to the db as the original value is 0.

TIA.

1
did you submit page items ?mohamad subhi bouchi

1 Answers

0
votes

Your code works if you pass a string value to setValue. This is because in APEX, all items (including grid cell values) are strings internally.

g.model.setValue(r[i], 'myColumn', '1');