Not able to clear dependent lov (merged 7) [message #674054] |
Mon, 31 December 2018 02:54  |
 |
firozali
Messages: 5 Registered: December 2018
|
Junior Member |
|
|
I have master detail form. Master Block have lov1 dependent to detail block lov2.
while updating if select lov1 dependent lov2 selected record should be clear.
my code below:
Declare
v_column XX_CC_SCM_REQ_LINES_V.TASK_NUMBER%type;
cursor my_cursor is
select TASK_NUMBER from XX_CC_SCM_REQ_LINES_V where PROJECT_ID = :XX_CC_SCM_REQ_HEADER_V.PROJECT_ID;
begin
open my_cursor;
fetch my_cursor into v_column;
if my_cursor%notfound then
:XX_CC_SCM_REQ_LINES_V.TASK_NUMBER := null;
end if;
close my_cursor;
end;
But its clear only one record. I have multiple line.
Please suggest me.
[EDITED by LF: applied [code] tags]
[EDITED #2 by LF: Michel merged 5 duplicates; I removed all but the original]
[Updated on: Tue, 01 January 2019 14:15] by Moderator Report message to a moderator
|
|
|
Re: form developer 10g [message #674056 is a reply to message #674054] |
Mon, 31 December 2018 07:44   |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
I don't understand your explanation, but Where is your loop? You cannot clear columns of a multi-record block unless you loop through all the rows.
|
|
|
Re: form developer 10g [message #674057 is a reply to message #674054] |
Mon, 31 December 2018 07:48   |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Maybe I misunderstood what you are saying, but - in a master-detail form, a detail block's LoV acts as master block's "master" LoV? Sounds opposite of how it should be.
Also, what does this mean:
Quote:if select lov1 dependent lov2 selected record should be clear.
What exactly do you select? Master's or detail's LoV? Which record should be cleared? Master? Detail? The last sentence suggests that it is the detail block, after all.
If so, then you'll have to loop through all rows in the detail block, check whether they satisfy the condition and ... well, "clear" them (whatever that means) - might be just setting some items to NULL, might be DELETE_RECORD built-in usage.
P.S. Right; exactly what Joy Division has said (didn't see his message as I was writing mine).
[Updated on: Mon, 31 December 2018 07:49] Report message to a moderator
|
|
|
|
|
Re: Not able to clear dependent lov [message #674086 is a reply to message #674082] |
Thu, 03 January 2019 03:28   |
cookiemonster
Messages: 13966 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Generally speaking you do something like this by looping through all the records in the detail block using:
go_block('<detail block');
first_record;
loop
<clear item>
exit when :system.last_record = 'TRUE';
next_record;
end loop;
However You can't do that from post-change or when-validate-item, as navigation built-ins are all restricted built-ins and so can't be run from those triggers. (read up on restricted built-ins in form builder help if you don't understand that).
There's no way I can think of to do what you want.
|
|
|
|
|