Home » Developer & Programmer » Forms » Multi Record block question--Very Urgent  () 2 Votes
icon4.gif  Multi Record block question--Very Urgent [message #174268] Sat, 27 May 2006 01:20 Go to next message
sruthi
Messages: 23
Registered: May 2006
Junior Member
Dear Gurus,

Scenario:
Block : Multi Record Block
Rquirmnt: when the user creates new record the form has to check a column values of previous rows. If it finds, say 5 times a specific value in previous rows user should not be allowed to create any more records.

I tried it using WHEN-NEW-RECORD-INSTANCE. Everything is working fine, but the processing is continuesly going as when the cursor come to last record it starts again the processing again and again.

Any work around would be very helpful.

Thanks
Sruthi
Re: Multi Record block question--Very Urgent [message #174274 is a reply to message #174268] Sat, 27 May 2006 02:43 Go to previous messageGo to next message
jowahl
Messages: 82
Registered: May 2006
Member
i guess you want to navigate through all records of the block to check some values (FIRST_RECORD - NEXT_RECORD)? so you have to implement in your LOOP:

IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
EXIT;
END IF;

the records appearing in your multi row block: have they all been just inserted by the user? in this case you could implement a variable to count how often a value had been inserted.

or did you get the records by query? so you may count the values in the database with a pl/sql function ...
Re: Multi Record block question--Very Urgent [message #174518 is a reply to message #174274] Mon, 29 May 2006 07:48 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I suggest that you populate a record group with the unique key and a count of the numebr of times that it has either been retrieved (use Post-Query trigger) or when data entered (test and populate in When-Validate-Item trigger).

David
Previous Topic: how to generate report output in excel file
Next Topic: i get a error message when i want to run my report?
Goto Forum:
  


Current Time: Fri Sep 20 09:39:22 CDT 2024