Home » Developer & Programmer » Forms » taking sumary when value in field changed
taking sumary when value in field changed [message #483898] Thu, 25 November 2010 06:55 Go to next message
swapnil_naik
Messages: 269
Registered: December 2009
Location: Mumbai
Senior Member

Hi,

I have a datablock like this
datablock name : jou_tra1_tab
No. of record dispalyed is 5

so datablock display like this

jtt_amt jtt_amt_1 ck_amt
jtt_amt jtt_amt_1 ck_amt
jtt_amt jtt_amt_1 ck_amt
jtt_amt jtt_amt_1 ck_amt
jtt_amt jtt_amt_1 ck_amt
----------------------------
ck_amt_tot


ck_amt is checkbox..
ck_amt_tot is total of jtt_amt_1 [but total only those record whose checkbox is checked]

My task is like this
When i checked checkbox whatever value in jtt_amt transfer to jtt_amt_1 field

but i can change value in jtt_amt_1 field ...i want to take addition of that changed field and show that sumation in ck_amt_tot.

I write trigger when-checkbox-changed like this
-------------------------------------------------
IF :jou_tra1_tab.ck_amt = 'Y' THEN
set_item_INSTANCE_property ('jou_tra1_tab.jtt_amt_1',CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_TRUE);
:jou_tra1_tab.jtt_amt_1 := :jou_tra1_tab.jtt_amt;
else
:jou_tra1_tab.jtt_amt_1 := 0;
END IF;

and when validation item trigger for jtt_amt_1 :
--------------------------------------------------
IF :jou_tra1_tab.ck_amt = 'Y' then
:jou_tra1_tab.ck_amt_tot := :jou_tra1_tab.ck_amt_tot + :jtt_amt_1 ;
else
:jou_tra1_tab.ck_amt_tot := :jou_tra1_tab.ck_amt_tot - :jtt_amt_1 ;


But when i changed value in jtt_amt_1 field i cant get write summation .

please help me...


Re: taking sumary when value in field changed [message #483953 is a reply to message #483898] Thu, 25 November 2010 17:16 Go to previous message
deepakmannazhi
Messages: 137
Registered: February 2010
Location: Dubai, UAE
Senior Member

Dear Swapnil,
You just use a summmary field for that.
Add a new item, set its
Quote:


calculation mode= summary
function=sum
block=your block name
field= jtt_amt_1.



And also set the Quote:
query all record
property of the block is to 'Yes'


Regards
Deepak
Previous Topic: how to open a .pdf file in oracle forms 10g
Next Topic: editor problem in form
Goto Forum:
  


Current Time: Thu Sep 19 00:14:12 CDT 2024