Home » Developer & Programmer » Forms » How to determine we are on the first record? (Form Builder 9.0.4.1.0, Windows XP Professional)
How to determine we are on the first record? [message #386657] Mon, 16 February 2009 08:19 Go to next message
scorpio4frenz
Messages: 48
Registered: October 2008
Member
I have a procedure which basically traverses through each detail block on my form, and explicitly fires a execute_query on each block. The procedure contains a for loop for the same. I'm using this procedure in key-nxtrec and key-prvrec triggers so that all the detail blocks get populated even when we navigate to next or previous record.

In the key-nxtrec, I'm using something like:
if  :system.last_record = 'TRUE' then
v_response := cfw$msgbox2('You are on the last row',cfw$const.cOkOnly, 'Information', 'CFG_INFORMATION');
else
next_record;


My question is, in the key-prvrec, how do i check if it is the first record? ":system.first_record" is not valid. I need a way to determine it is the first record and show a "v_response" similar to my code posted above. Right now when I'm on first record, an error message pops up (FRM-40100). I want to suppress that pop up.

Any help is greatly appreciated.
Re: How to determine we are on the first record? [message #386664 is a reply to message #386657] Mon, 16 February 2009 08:47 Go to previous messageGo to next message
cookiemonster
Messages: 12415
Registered: September 2008
Location: Rainy Manchester
Senior Member
To half inch some code Littlefoot posted on another thread:
if :system.trigger_record = '1' then
   null;
else
   do_whatever_you_are_doing_now;
end if;


That said what you are doing sounds like it should be forms default behavour so if it's not working you might be better off working out why and fixing it rather than reinventing the wheel.

As for supressing messages - have a read up on system.message_level in form builder help.
Re: How to determine we are on the first record? [message #386666 is a reply to message #386664] Mon, 16 February 2009 08:51 Go to previous message
scorpio4frenz
Messages: 48
Registered: October 2008
Member
Cookiemonster,

Thanks for the response. I know it is forms default behavior. I'm reinventing the wheel because of some issues with creating forms in Oracle Designer. Some things don't work as expected when created in Designer. (I had posted a thread previously on that).

Anyway, thanks for the pointers. Greatly appreciate the quick reply.
Previous Topic: How to disable specific button in a tabular form
Next Topic: How to pass parameter in query ( for in clause)?
Goto Forum:
  


Current Time: Wed Dec 07 14:16:26 CST 2016

Total time taken to generate the page: 0.19216 seconds