Button trigger filling multiple fields in detail-form ? [message #409710] |
Tue, 23 June 2009 10:14 |
ICTstudent
Messages: 5 Registered: June 2009 Location: holland
|
Junior Member |
|
|
hello guys
Im trying to create a button that replaces all the entries of a single column with the same entry, which is the ID of the highest entry from another column.
So, I put a button down on the form with a "When_button_pressed" trigger with the following pl/sql code:
BEGIN
IF :kavel.kavelid IS NOT NULL THEN
SELECT bod.bodid
into :kavelbod.bodid
FROM bod
where bod.kavelid = :kavel.kavelid
HAVING :kavelbod.bedragf = MAX(:kavelbod.bedragf)
GROUP BY bod.bodid;
end if;
-- een join van bod en kavel want kavel heeft geen bodid
EXCEPTION
when no_data_found then
message( 'Geen data gevonden' );
raise form_trigger_failure;
END;
Now the problem is that there are multiple boxes that need to be filled, and this trigger can only fill one. any ideas?
|
|
|
|
Re: Button trigger filling multiple fields in detail-form ? [message #409716 is a reply to message #409714] |
Tue, 23 June 2009 10:47 |
ICTstudent
Messages: 5 Registered: June 2009 Location: holland
|
Junior Member |
|
|
thanks for replying!
Well, I dont want to fill just one item, but a column
What I'm trying to do is creating a button that is supposed to replace all "bodID" entries in the detail part of the form with the "bodID" of the highest amount of money ("bedragf") offered for an item.
here is an image of the detail part of the master-detail form im trying to do this with:
f.imagehost.org/0377/knopje.jpg
Every row is a bid on an item. The one with the highest bid (highest bedragf), needs to have it's bodid placed in every field of the bodid column.
Im clueless about how i should achieve this :s
[Updated on: Tue, 23 June 2009 10:48] Report message to a moderator
|
|
|
|
Re: Button trigger filling multiple fields in detail-form ? [message #409721 is a reply to message #409710] |
Tue, 23 June 2009 11:14 |
ICTstudent
Messages: 5 Registered: June 2009 Location: holland
|
Junior Member |
|
|
so something like
go_block('KAVELBOD');
first_record;
LOOP
IF :kavel.kavelid IS NOT NULL THEN
SELECT bod.bodid
into :kavelbod.bodid
FROM bod
where bod.kavelid = :kavel.kavelid
HAVING :kavelbod.bedragf = MAX(:kavelbod.bedragf)
GROUP BY bod.bodid;
end if;
EXIT WHEN :sytem.last_record = 'TRUE';
next_record;
end loop;
Would this work? Assuming the last two columns in the picture are from the 'KAVELBOD' block?
|
|
|
|
|
|
|
|
|