Home » Developer & Programmer » Forms » Compare two rows (Forms 11g)
icon5.gif  Compare two rows [message #612130] Sat, 12 April 2014 11:17 Go to next message
irene_engg
Messages: 1
Registered: April 2014
Junior Member
Hi All

I have a form with 5 blocks and each block is based on a complex view/DOV. In one particular block there are 3 fields A,B,C being displayed and is of type tabular. There is an LOV for field A and A,B and C are populated from the same LOV. So say if a user enters 3 rows in the block,before saving he must get a message if duplicated are selected from the LOV. Each row is uniquely identified by a job ID that is not being displayed in the form.Please help.

Regards
Irene
Re: Compare two rows [message #612137 is a reply to message #612130] Sat, 12 April 2014 13:04 Go to previous message
Littlefoot
Messages: 21805
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).
Previous Topic: hide push button
Next Topic: Tracing forms in oracle forms 11g
Goto Forum:
  


Current Time: Tue Mar 19 05:39:05 CDT 2024