Re: LOV for Searching.

From: DA Morgan <damorgan_at_exxesolutions.com>
Date: Wed, 26 Mar 2003 16:24:52 -0800
Message-ID: <3E8244D3.3F9BB57C_at_exxesolutions.com>


Smoke Williams wrote:

> Hello,
> I am working on an application that uses a LOV to get a list of
> project titles, then the users can select a project title from the
> list and they should go to that record. I thought it was working, but
> it isn't working right.
>
> Here is the code behind the When-button-pressed trigger
> DECLARE
> item_selected BOOLEAN;
> row_id NUMBER;
> status NUMBER;
> BEGIN
> --Show the List of Values
> item_selected := show_lov('project_search_lov');
> --Populate the record group
> status := populate_group('project_search_rg');
> execute_query;
> --Use the get_group_record_number built in to get the row_id of the
> selected value from the list of values
> row_id := get_group_record_number('project_search_rg.project_title',:Parameter.item_name);
> --Use the row id to navigate to the selected record
> go_record(row_id);
> EXCEPTION
> WHEN OTHERS THEN
> message(ERROR_TEXT);
> --exception handler
> END;
>
> So this seems to work, sometimes, but other times it goes to the first
> record, or goes somewhere completely different. Any help would be
> greatly appreiciated. Thanks.

I think you will have more success if you accept the value from the LOV to a hidden field, then dynamically modify the WHERE clause on the block using the returned value and re-query the block.

Daniel Morgan Received on Thu Mar 27 2003 - 01:24:52 CET

Original text of this message