Home » Developer & Programmer » Forms » Calculated Field is not working properly (Oracle forms 6)
Calculated Field is not working properly [message #644590] Tue, 10 November 2015 09:20 Go to next message
tusharsn
Messages: 1
Registered: November 2015
Location: Pune
Junior Member
Hello Everyone,

Requirement:-
I have one requirement as below
P = 'L'
A = (b+1.2)/2
P = 'N'
A = (b+1.6)/3
where A is calculated field.

Solution Used:-
Now I have used
A as text item, used formula in calculation and below formula is as below. P and B are coming from table.
Case WHEN P = 'L'
THEN (b+1.2)/2
WHEN P = 'N'
THEN A = (b+1.6)/3
ELSE 0
END

In Block Number of record display = 5


Issue :-

So now when value of B is not Null it will show me correct calculated value. However when i click on some field in block where value of B is null. It will change the value of A in other field as 0.

I need to know what logic i should add so that if i click on block where value of B is Null. It shouldn't affect other block.

Regards,
Tushar
Re: Calculated Field is not working properly [message #644591 is a reply to message #644590] Tue, 10 November 2015 09:37 Go to previous messageGo to next message
cookiemonster
Messages: 13895
Registered: September 2008
Location: Rainy Manchester
Senior Member
The case statement above is invalid - you can't have a boolean expression in a then clause, only in a when.
So posting the code you actually used would help, along with making clear exactly where you've put the formula in the code.
I would have thought that b being null would result in a being null, rather than 0, unless there's some other code taking affect.
Re: Calculated Field is not working properly [message #644671 is a reply to message #644591] Thu, 12 November 2015 16:31 Go to previous message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Well, your code sample has an ELSE clause on the CASE statement. My guess is that you're hitting this.
Previous Topic: sent csv file in oracle forms
Next Topic: How to create Oracle tree menu and calling form from tree menu ??
Goto Forum:
  


Current Time: Fri Oct 30 06:33:49 CDT 2020