Home » Developer & Programmer » Forms » no navigation happening (forms 6i,win xp)
no navigation happening [message #328458] Fri, 20 June 2008 04:40 Go to next message
sharathmpatil
Messages: 38
Registered: February 2008
Location: Bangalore
Member
hi,
Please observe the code in the attachment.The cursor is not moving to the next specified item .Please check out and specify the solution.

Thanks in advance
  • Attachment: code.txt
    (Size: 0.55KB, Downloaded 976 times)
Re: no navigation happening [message #328461 is a reply to message #328458] Fri, 20 June 2008 04:44 Go to previous messageGo to next message
sharathmpatil
Messages: 38
Registered: February 2008
Location: Bangalore
Member
Hi,
The piece of code is written in key-next-item trigger block.

Regards
Re: no navigation happening [message #328464 is a reply to message #328458] Fri, 20 June 2008 04:48 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Which item is the "next specified item"?

If "nothing happens", check value and length of ":iss.tray_no" item, as well as "mcount" variable value (why do you store a numeric value into a CHAR (char???) variable?).

In other words, it is called debugging. Except your code, we have NO IDEA what is going on; we don't have your tables, don't know values you enter - nothing at all.
Re: no navigation happening [message #328467 is a reply to message #328464] Fri, 20 June 2008 05:01 Go to previous messageGo to next message
sharathmpatil
Messages: 38
Registered: February 2008
Location: Bangalore
Member
Hi littlefoot,
Next item is quantity field.But the tray number is alphnumeric so it is made as character type.The value of count is correct.And its also validating whether the tray_no is 8 digits or not but the navigation i,e its not going to the next field.

Regards
Re: no navigation happening [message #328473 is a reply to message #328467] Fri, 20 June 2008 05:23 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
COUNT function returns a number. You are storing it into CHAR(8) variable.

Length of a CHAR datatype column is fixed, no matter what's in there:
SQL> create table test (col char(8));

Table created.

SQL> insert into test (col) values ('abc');

1 row created.

SQL> insert into test (col) values ('12ab   ');

1 row created.

SQL> select col, length(col) from test;

COL      LENGTH(COL)
-------- -----------
abc                8
12ab               8

SQL>
Unless it is 8 characters long, perhaps you'd rather use VARCHAR2 datatype:
SQL> create table test (col varchar2(8));

Table created.

SQL> insert into test (col) values ('abc');

1 row created.

SQL> insert into test (col) values ('12ab   ');

1 row created.

SQL> select col, length(col) from test;

COL      LENGTH(COL)
-------- -----------
abc                3
12ab               7

SQL>



Why did you make a difference when referencing an item in the GO_ITEM built-in?
Line  8: go_item('tray_no');
Line 22: go_item(':iss.qty');
Re: no navigation happening [message #328478 is a reply to message #328458] Fri, 20 June 2008 05:37 Go to previous messageGo to next message
sharathmpatil
Messages: 38
Registered: February 2008
Location: Bangalore
Member
Hi littlefoot,
Let me check with what you ve said.
Regards
Re: no navigation happening [message #328584 is a reply to message #328458] Fri, 20 June 2008 09:47 Go to previous messageGo to next message
Martin Eysackers
Messages: 80
Registered: October 2005
Location: Belgium
Member
I put some remarks about your code in bold
declare 
 mcount char(8);
 a number;
begin
	if :iss.tray_no  is null then
		g.dummy := g.cent('Tray No. Cannot be Blank',1,1);
		 raise form_trigger_failure;
               [B]this will never happen you just stopped the trigger in the previous line[/B]
		 go_item('tray_no');
	end if;
   select count(*) into mcount from iss
		where rtrim(lower(tray_no)) = lower(rtrim
[B]should it not be :iss.trayno without ''[/B]
(':iss.tray_no')) and
		  sl_no <> :iss.sl_no;
      if mcount > 0 then
  		g.dummy := g.cent('Tray No. already exists',1,1);
		raise form_trigger_failure;
	end if;	

a :=	length(':iss.tray_no');
[B]a will always be > 8, you probably meant length(:iss.tray_no)[/b]
if a != 8 then
	raise form_trigger_failure;
end if;
[B]you probably meant without :, also if a <> 8 you never get here[/B]
go_item(':iss.qty');
end;


and like Littlefoot said, use number instead of char(8)

[EDITED by LF: disabled smilies in this message]

[Updated on: Fri, 20 June 2008 15:23] by Moderator

Report message to a moderator

Re: no navigation happening [message #328608 is a reply to message #328584] Fri, 20 June 2008 15:23 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Martin,

unfortunately, we can't use text formatting when [code] tags are being used. Also, some combinations of special characters are "translated" into smilies.

Therefore, perhaps you'd want to use "Preview Message" button prior to submitting it (just to see how it will look like). Moreover, there's a "Disable smilies in this message" checkbox in the Options section which will prevent your code turn into smilies.
Re: no navigation happening [message #328663 is a reply to message #328458] Sat, 21 June 2008 05:41 Go to previous message
Martin Eysackers
Messages: 80
Registered: October 2005
Location: Belgium
Member
Littlefoot,


thanks for pointing that out to me, I noticed it
I was hoping the OP would be smart enough to realize anything between
[b] and [/b]
would in fact be bold Smile

I had no idea you could turn smilies of

I hope the OP can do someting with my solution Smile

[Updated on: Sat, 21 June 2008 13:44]

Report message to a moderator

Previous Topic: How to attach add LOV to list item
Next Topic: When-validate-item
Goto Forum:
  


Current Time: Thu Feb 13 08:31:21 CST 2025