This discussion is archived
1 Reply Latest reply: Jan 2, 2013 9:40 AM by Andreas Wismann RSS

Make a htmldb_item.select_list_from_query field updateable

jmadden Newbie
Currently Being Moderated
Apex 4.2 on Windows 7

What I'm doing is generating a report based on a SQL query that is based on a user's selection of an LOV field (driving predicate) the end result is that we create a matching set of data for a new Organization based on an existing organization.

This works fine. But what I would like to do is give the user the abiility to "template the data" based on the existing org's data AND make any minor tweaks before submitting the load button. I.E updateable report i guess

What I am finding is that my region displays just but my LOV for fields is not updateable/changeable.

If I change the value using the lov displayed by HTMLDB_ITEM.SELECT_LIST_FROM_QUERY , the value reverts back to the original.
I image this is because I have this as a standard report field in order to display properly and the insert of data works fine ( i loop through the f01 .... elements etc...with an insert.

So the question really is .....if I generated a report using htmldb_item.select_list_from_query as shown below , how can I make the LOV field that the select generated retain the changed value ?

What am i missing to have the lov change the session value for the F05 value?

Code looks like.. ....

Select ......

htmldb_item.display_and_save(4,ORG_ID_NUMERIC) ORG_ID_NUMERIC,
HTMLDB_ITEM.SELECT_LIST_FROM_QUERY(5,WL_LEVEL,'select distinct wl_level, wl_level from idt_org_derog_rule') WL_LEVEL,
.......
from Tab where org_id = :P12_create_like
  • 1. Re: Make a htmldb_item.select_list_from_query field updateable
    Andreas Wismann Explorer
    Currently Being Moderated
    Hi,

    reflecting the user's changes doesn't work here because the SELECT statement has no way of remembering what the user has chosen.
    'select distinct wl_level, wl_level from idt_org_derog_rule
    always yields the same list ("static" if you will).

    Using a report and SELECT_LIST_FROM_QUERY is the right way to go, only you need to persist the user's choice.
    Are you familiar with APEX Collections? They are exactly what you are looking for.

    If not, you'd have to create some imtermediate table to store the user's input row by row, and then re-select them each time. The key is to select the former value into the second parameter p_value.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points