Forum Stats

  • 3,767,860 Users
  • 2,252,726 Discussions


Interactive Grid column with "Function body returning PL/SQL" gives errors referencing columns

Gerard Otin
Gerard Otin Member Posts: 16 Blue Ribbon
edited Apr 21, 2021 11:06AM in APEX Discussions

Hello everyone,

Lets suppose I have a table with 2 columns (A and B). One of these columns (A) will define the LOV of the other (B).

I have an IG with column B set to "Popup LOV" and the list of values being "Function body returning PL/SQL". I have put this demo query:

  if :A = '1' then
    return 'select state_name d, st r from demo_states';
  elsif :A = '2' then
    return 'select product_name d, product_id r from demo_product_info';
    return 'select null d, null r from dual';
  end if;

So, when the column A = 1, the LOV of column B will be different of the LOV when A = 2.

This works when inserting a new row. But when the grid loads for the first time, it does not recover the "display value" of any value. So the user always see in the grid the "return value" of the LOV. Debug shows this error: "ERR-1002 Unable to find item ID for item "A" in application "131181"".

Column "A" is set as a "Parent" and "Items to submit" properties in column B. Required is set to false.

It seems this is a bug. Anyone have encountered this? What can I do?

Any help would be appreciated,