Home » Developer & Programmer » Forms » LOV showing wrong record
LOV showing wrong record [message #146791] Sun, 13 November 2005 23:26 Go to next message
tzd1
Messages: 24
Registered: October 2005
Location: Gibbsboro
Junior Member
I have set up a LOV Button which is showing the popup with the appropriate records, but after I select any record the first records shows in the form instead of the selected record.

My Data block on the form includes an original table student.s_id, student.last, student,.first,student.phone, and student.dob. the s_id has the associated button which calls up the LOV. the form block I am inserting the data from the pull up is student_reg.

Another issue ids the LOV popup table has the fields spread out, so you have to scroll to the right to see all the fields.

hers is my PL/SQL associated to the button which calls up the LOV table:
set_item_property('student_reg.s_id',enabled,property_true);
go_item('student_reg.s_id');
list_values;
show_view('enrollment_summary');
:system.message_level:=10;
execute_query;
:system.message_level:=0;
--go_block ('enrollment_summary');
go_item('student_reg.s_first');
set_item_property('student_reg.s_id',enabled,property_false);
set_item_property('student_reg_palette.stud_update_butt',enabled,property_true);
if :student_reg.s_id is not null and :course_section_reg.c_sec_id is not null then
set_item_property('student_reg_palette.save_butt',enabled,property_true);
end if;

Re: LOV showing wrong record [message #146795 is a reply to message #146791] Sun, 13 November 2005 23:36 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Is 'student_reg.s_id' a displayed field?

David
Re: LOV showing wrong record [message #146797 is a reply to message #146795] Sun, 13 November 2005 23:40 Go to previous messageGo to next message
tzd1
Messages: 24
Registered: October 2005
Location: Gibbsboro
Junior Member
I have it as a Text Item.
Re: LOV showing wrong record [message #146799 is a reply to message #146797] Sun, 13 November 2005 23:51 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I suggest having simpler code
declare
  a_value_chosen BOOLEAN;
begin
  go_item('student_reg.s_id');
  a_value_chosen := Show_Lov('s_id_lov');
  IF NOT a_value_chosen THEN
    Message('You have not selected a value.');
    Bell;
    RAISE Form_Trigger_Failure;
  END IF;
end;

Define the records to be retrieved in a record group which is referenced by the LOV which has a return value to populate your field.

If you want the LOV columns to be narrower then make the column size smaller.

David
Previous Topic: How to debug the form in Multi-application
Next Topic: Forms 6i: Howto Dock & Anchor
Goto Forum:
  


Current Time: Fri Sep 20 03:34:26 CDT 2024