Home » Developer & Programmer » Forms » when-validate-item giving strange behavior (Forms 6.0.8.8.0)
when-validate-item giving strange behavior [message #394647] Sun, 29 March 2009 04:25 Go to next message
dude4084
Messages: 222
Registered: March 2005
Location: Mux
Senior Member
Hi

I am facing strange problem now-a-days. The when-validate-item trigger usually fails.
Let me explain:

Here is image of my screen.

/forum/fa/5961/0/

The when-validate-trigger on unit price has following code.

declare
	chk_button number;
begin
  message(:inv1p.uprice); pause;
if :inv1p.uprice<=0 then
set_alert_property('alert_info' ,title,'Info');
set_alert_property('alert_info' ,alert_message_text,'Price can not be negative');
chk_button:=show_alert('alert_info');
raise form_trigger_failure;
end if;
end;



You notice that in above code i have checked the value of uprice in "message(:inv1p.uprice); pause;" . The image is taken when i have entered 55 as unit price and thus 55 is being displayed in Messaged in bottom line of the screen.

The problem begins after this line as "if :inv1p.uprice<=0 then" has test gives me TRUE which is against the logic of 55<=0. Thus the alerts comes in front of me saying Price can not be negative.

Can not understand whats going on.

Any comments?


N.B. Many times this problem is fixed by delete the trigger and creating the new trigger and re-writing the code(Copy/pasting code only)
  • Attachment: problem.jpg
    (Size: 47.64KB, Downloaded 1030 times)
Re: when-validate-item giving strange behavior [message #395545 is a reply to message #394647] Wed, 01 April 2009 18:07 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please confirm that your item IS 'inv1p.uprice'. What datatype do you have on this item?

David
Re: when-validate-item giving strange behavior [message #395581 is a reply to message #394647] Wed, 01 April 2009 22:56 Go to previous messageGo to next message
dude4084
Messages: 222
Registered: March 2005
Location: Mux
Senior Member
Rezpected David.

The item is 'inv1p.uprice'

The datatype is number at form level as well as backend level.


-Dude
Re: when-validate-item giving strange behavior [message #395876 is a reply to message #395581] Thu, 02 April 2009 23:52 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please do a Ctrl-Shft-k (Compile All) and a generate and see if that makes any difference.

Try using "message('>'||to_char(:inv1p.uprice)||'<');" for your message command and see what happens.

David
Re: when-validate-item giving strange behavior [message #396109 is a reply to message #395876] Sat, 04 April 2009 00:37 Go to previous messageGo to next message
dude4084
Messages: 222
Registered: March 2005
Location: Mux
Senior Member
Dear David

As i was needing solution at that time, so i deleted the trigger and rebuilt it. (And just copying the code in buffer before deleting and pasting it later on when created). This had solved my problem.


I used to do Ctrl+T instead of Shift+Ctrl+k. Does it make any major difference?

Anyhow, I will test your suggestions when i will fall in the fix once again.


-Dude
Re: when-validate-item giving strange behavior [message #396145 is a reply to message #396109] Sat, 04 April 2009 05:26 Go to previous messageGo to next message
itech
Messages: 173
Registered: May 2008
Location: Fsd, Pakistan
Senior Member

dude4084 wrote on Sat, 04 April 2009 10:37
Dear David

As i was needing solution at that time, so i deleted the trigger and rebuilt it. (And just copying the code in buffer before deleting and pasting it later on when created). This had solved my problem.


I used to do Ctrl+T instead of Shift+Ctrl+k. Does it make any major difference?

Anyhow, I will test your suggestions when i will fall in the fix once again.


-Dude


if u get such unexpected outputs better re-compile the form using CTRL+SHIFT+K, and as in your case the problem was that form was not compiled correctly.

CTRL+k ==> Incremental Compile.
CTRL+SHIFT+K ==> Compile All.

[Updated on: Sat, 04 April 2009 05:27]

Report message to a moderator

Re: when-validate-item giving strange behavior [message #396179 is a reply to message #396145] Sat, 04 April 2009 12:43 Go to previous messageGo to next message
dude4084
Messages: 222
Registered: March 2005
Location: Mux
Senior Member
Dear Dude

I will try your suggestion whn i will get into problem again. Wish me that i get into problem soon Laughing

-Dude
Re: when-validate-item giving strange behavior [message #396498 is a reply to message #396109] Tue, 07 April 2009 00:02 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If it didn't make a difference I wouldn't have asked you to do it.

David
Re: when-validate-item giving strange behavior [message #396578 is a reply to message #396498] Tue, 07 April 2009 04:37 Go to previous message
dude4084
Messages: 222
Registered: March 2005
Location: Mux
Senior Member
djmartin wrote on Tue, 07 April 2009 10:02
If it didn't make a difference I wouldn't have asked you to do it.

David


Smile
Previous Topic: Looping is not working
Next Topic: How to get ip/host form server
Goto Forum:
  


Current Time: Sun Feb 09 11:05:33 CST 2025