Home » Developer & Programmer » Forms » Synchronise multiple lists
icon7.gif  Synchronise multiple lists [message #156388] Wed, 25 January 2006 02:49 Go to next message
dewoljo
Messages: 3
Registered: January 2006
Location: Belgium
Junior Member
I'm playing a bit with forms now and I've got a question for all of you.

I created 3 list items for eacht column of the table dept(deptno, dname, loc). With a when_new_form_instance trigger I'm able to load every list item with the proper values.
But now the problem, I want them to be synchronise with each other. So when you select a deptno the other list items have to show the values wich are correct for this deptno.

Can anyone give me some tips or parts of code I can use? I know I have to use a when_list_changed trigger but don't know the code for it.
Re: Synchronise multiple lists [message #156393 is a reply to message #156388] Wed, 25 January 2006 02:57 Go to previous messageGo to next message
vban2000
Messages: 207
Registered: March 2005
Senior Member
hi..

just a thought..

reterive deptno (which is unique..) and use it as condidtion to reterive the value.

example ...
select	emp_dname
into	:dept_name
from	dept
where	dept_id = :dept_no;


Re: Synchronise multiple lists [message #156401 is a reply to message #156393] Wed, 25 January 2006 03:14 Go to previous messageGo to next message
dewoljo
Messages: 3
Registered: January 2006
Location: Belgium
Junior Member
How can I retrieve a value from a list item? I can only retrieve_list but then I get the complete list and not the selected item, right?
Re: Synchronise multiple lists [message #156478 is a reply to message #156388] Wed, 25 January 2006 06:08 Go to previous messageGo to next message
vban2000
Messages: 207
Registered: March 2005
Senior Member
Hi

what is the name of your fist List Item (say its :list_deptno)! then using :list_deptno should give you the current selected value.

Add the following to your when_list_changed trigger and check if you see anything.

message(:list_deptno);
message(:list_deptno);


Regards
Andy
Re: Synchronise multiple lists [message #156480 is a reply to message #156478] Wed, 25 January 2006 06:31 Go to previous messageGo to next message
dewoljo
Messages: 3
Registered: January 2006
Location: Belgium
Junior Member
The message build in doesn't show anything.
I created 3 text field and I putted the variabeles in there for when I select an deptno. The other text fields are filled in properly with the correct values (also when I change the deptno).
But when I change the query so the 2 other field will be putted in the list items, I get an error: "Invalid value for the field lst_loc".
The following code is in the when_list_changed trigger:
:deptno_from_list := :lst_deptno;
select loc, dname
into :lst_loc, :lst_dname
from dept
where deptno = :deptno_from_list;

:LST_... is the list item (duh)
:..._from_list is the text item (duh too)
Re: Synchronise multiple lists [message #156589 is a reply to message #156388] Thu, 26 January 2006 02:09 Go to previous message
vban2000
Messages: 207
Registered: March 2005
Senior Member
Hi dewoljo

The code seems ok to me, I fail to figure out why it is not working.

'Invalid value for the field lst_loc' usually means that the value you are assigning is not matching to the List of Value allowed.

so I think its time for some debug ~~ Wink you can do a message (search the help on the Form Builder, if desired) and see what value is assigning to the text item and check the LOV you for the deptartname name and location - to see if they are matching..

Hope This Helps!

Best Wishes
Andy
Previous Topic: Tab page problem help needed
Next Topic: Need to Know Insert_allowed Property.
Goto Forum:
  


Current Time: Fri Sep 20 06:31:09 CDT 2024