Skip to Main Content

ERR-1002 - Query Only

After an update from Apex 18.2 to 19.2, some pages with Interactive Grids started producing this type of error when saving changes using a "Interactive Grid - Automatic Row Processing (DML)" process:
ERR-1002 Unable to find item ID for item "SOME_NAME" in application "12345"
It's a bit of a sneaky one, because on the page itself you get no indication that there is a problem; it just doesn't save the changes. The error is raised, which you can see in the debug log, but it is not raised to the page itself.
I'm not entirely sure the update was the cause, but since the page worked fine before I highly suspect it was.

After 2 hours of debugging I found the cause. It turns out that the Query Only setting for any Interactive Grid column that is to be changed, has to be set to Disabled. If not, you get the error above - in 19.2 anyway.
You can find the setting here: IG Column "SOME_NAME" => Source => Query Only. Change this from Enabled to Disabled.

A quick and dirty query to find columns like this:

ERR-1002 - Primary Key

This one took another bug hunt, 3 hours this time:
Cascading LOV's in an Interactive Grid can also give this error, when the user changes the value of the Parent Column on the page.
The query for the Child Column, which will have :PARENT_COLUMN in the where clause, will fail with: ERR-1002 - unable to find item ID for item "PARENT_COLUMN" in application "999".
Note that this error is (again) NOT shown on the page, only in the console and the debug views.

In my case this had nothing to do with the 2 parent/child column definitions or with the LOV queries.
The cause turned out to be the column that I had used as the Primary Key. In the query of the IG this column was always null.
Since all the rows I needed to edit were empty anyway this seemed logical enough; the primary key would be filled by a trigger later.
But this was the cause for the ERR-1002 error.
So choosing a Primary Key column that was not null solved the problem.