|
Re: Compare two rows [message #612137 is a reply to message #612130] |
Sat, 12 April 2014 13:04 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
One option is to rewrite LoV's query so that it looks at values already selected. As you do care about duplicates, I guess that these rows belong to a common, let's call it MASTER_ID. In that case, LoV's query might look like
select t.a, t.b, t.c
from lov_table t
where t.id not in (select d.id
from data_table d
where d.master_id = :block.master_id --> this line
)
In order to be able to use it, you'll have to POST values already entered into a block. You can do that in, for example, WHEN-NEW-RECORD-INSTANCE trigger:
-- consider "hiding" POST notification by setting :SYSTEM.MESSAGE_LEVEL
-- to a higher value and then restoring it back
post;
A line I marked in SELECT statement: I can't remember whether it is allowed to do that in Record Group's query (created during design time). If not, you'll have to switch to dynamically created query (search Forms Online Help for more info) (I don't have access to Forms right now).
|
|
|