Home » Developer & Programmer » Forms » Problem when create sequence (Form 6i)
Problem when create sequence [message #377411] Mon, 22 December 2008 22:12 Go to next message
aorlunla
Messages: 20
Registered: March 2008
Junior Member
Hello everybody,

I try to make sequence with each record when I'm in first record line number will show '1' and when I'm in second record line number will show '2'. for my problem I use when-new-record-instance with this code

BEGIN	
if :DT_BLOCK.LINE_NO  is null then
			if :DT_BLOCK.CNT_LINE is null then
				:DT_BLOCK.LINE_NO :=1;
        end if;
else 				:DT_BLOCK.LINE_NO := :DT_BLOCK.CNT_LINE +1;
end if;
END;


(:DT_BLOCK.CNT_LINE is use for sum record)

but my line number will change when I click to another record like if I want to change line number to '2' in second record I have to click to first record or clike 'detail button' to change to another page so line number will change to '2'

In another way I try to use another trigger
I use when-new-record-instance with this code:

if :DT_BLOCK.LINE_NO is null then
	:DT_BLOCK.LINE_NO:=:DT_BLOCK.CNT_LINE +1;
end if;


and when-mouse-click with this code:

if :DT_BLOCK.LINE_NO is null then
			if :DT_BLOCK.CNT_LINE is null then
				:DT_BLOCK.LINE_NO:=1;		  
        end if;
end if;


with this when I go to second record line number will change to '2' but when I choose customer_name from LOV line number will always return to '1'

how can I solve this problem? please help.

Regards,
aorlunla
Re: Problem when create sequence [message #377529 is a reply to message #377411] Tue, 23 December 2008 06:24 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
All you've done is just too complicated. There's an easy way to do that, and it is called :SYSTEM.TRIGGER_RECORD. So, for every new record, you might create a WHEN-CREATE-RECORD trigger which would look like
:block.sequence_number_item := :system.trigger_record;
That's all.

Perhaps you'd want to read about other system variables as well; you might learn something new.
Re: Problem when create sequence [message #377610 is a reply to message #377411] Tue, 23 December 2008 20:21 Go to previous messageGo to next message
aorlunla
Messages: 20
Registered: March 2008
Junior Member
Dear Littlefoot,

I try with :SYSTEM.TRIGGER_RECORD already but same answer when I choose for customer from LOV Line_number will return to '1' i every record.

Regards,
aorlunla

edit :

Now I can solve all problem already thank you so much.

[Updated on: Wed, 24 December 2008 00:13]

Report message to a moderator

Re: Problem when create sequence [message #398963 is a reply to message #377610] Mon, 20 April 2009 01:03 Go to previous message
masifqadri12
Messages: 6
Registered: March 2007
Junior Member

how you resolve this kindly mention
Previous Topic: How to use format mask to replace fix length item property?
Next Topic: creating tree in oracle form
Goto Forum:
  


Current Time: Thu Dec 08 14:33:33 CST 2016

Total time taken to generate the page: 0.09317 seconds