Records navigation problem [message #154048] |
Thu, 05 January 2006 08:41 |
karan.shandilya
Messages: 64 Registered: July 2005 Location: mumbai
|
Member |
|
|
Hi to all.
I am facing the records navigation problem in my form which has two blocks
1: employee_hist_1
2: employee_hist;
I am writing the code of when-button-pressed TRIGGER which is on block 1st.
After taking the value in search_criteria field when i press this button
2nd block shows the matching records.
But when there are more then one records for search_criteria value it ONLY SHOWS
one record.
THE CODE IS------
:global.dat:=:employee_hist_1.search_criteria;
Declare
A number;
CURSOR Cursorss
Is SELECT first_name,rank,name,desig,job_code
WHERE upper(first_name)=upper(:global.dat) OR
upper(middle_name)=upper(:global.dat) OR
upper(last_name)=upper(:global.dat);
BEGIN
IF upper (:employee_hist_1.search_criteria) is null THEN
A:=show_alert('alert50');
message('Field is Empty');
RAISE Form_Trigger_Failure;
END IF;
OPEN Cursorss;
First_record;
Loop
Fetch cursorss into :employee_hist.first_name,
:employee_hist.rank,:employee_hist.name,:employee_hist.desig,:employee_hist.job_code;
EXIT When Cursorss%NOTFOUND;
Next_Record;
End LOop;
Close Cursorss;
END;
First_Record;
Erase(:global.dat);
GO_BLOCK('employee_hist');
So please tell me where i am wrong.
Karan.
|
|
|
|
|
Re: Records navigation problem [message #154337 is a reply to message #154051] |
Sat, 07 January 2006 01:11 |
karan.shandilya
Messages: 64 Registered: July 2005 Location: mumbai
|
Member |
|
|
Hi Harsha,
Thanx to you for your help. Here i am elaborate my previous message.
I am using two 2 canvas for each blocks. On one canvas there is one 'search_criteria' text item and a button, code for button i already wrote in my previous message.
Now when the button is pressed focus goes to second block(2nd canvas) which has fields which i wrote in code.
My form shows only a single record for 'search_criteria' field eventhough it has more then one record.
Now I hope that you will find out solution.
Karan.
|
|
|
|
|
|
|