Formula column value not updating in table? [message #521958] |
Mon, 05 September 2011 04:20 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
mm_kanish05
Messages: 493 Registered: January 2007 Location: Chennai
|
Senior Member |
![mm_kanish05%40yahoo.co.in](/forum/theme/orafaq/images/yahoo.png)
|
|
Hi all,
I create the sample for master/detail form. In detail for prdcode,rate,qty,amount is there. When select prdcode it fetching prdcode,rate in a record and if you type the qty the amout will come based on formula(property) :qty*:rate.
It is available on screen. But when i store the data, in backend table the amount is be a null.
What is the problem.
Help me in this regards,
kanish
|
|
|
|
|
Re: Formula column value not updating in table? [message #521972 is a reply to message #521961] |
Mon, 05 September 2011 05:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
as i experienced database item can't work as formula item,
u can deal it by having a control item as a formula item like (amount_) and on when_validate_recode trigger u can assign the value of (amount_) to amount(database item) column in detail block,
in master block u can do the same on pre_commit trigger
|
|
|
|
Re: Formula column value not updating in table? [message #521981 is a reply to message #521978] |
Mon, 05 September 2011 05:25 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
Littlefoot wrote on Mon, 05 September 2011 15:16Actually, what you (mm_kanish05) are doing is wrong. Data model violates normalization principles. In other words: it is OK to store quantity and rate values, but it is wrong to store "quantity * rate". It can always be presented in any reporting tool you use, in a very simple manner.
However, if you decide to store all three values, you have to make sure that every time someone updates quantity or rate, you have to update amount as well. Or: what will you do if someone updates the AMOUNT column's value? How will you recalculate quantity and/or rate?
So: drop that column and live without it.
please also guide if we need the sum of amount(detail block) to be saved in master block item(column) then ? the case is same ? now what to do ?
|
|
|
|
|
|
|