I have created a master detail form by Item & Grid. Qty * Rate = amount. I want the sum of the amount to be in total amount. before pressing the save button. how can i do this?
https://apex.oracle.com/pls/apex/saidul_abc/r/master-detail10/login?session=107768956176789
User/Pass: demo/123
Give a static id to your interactive grid, for example, itemig.
Then create a dynamic action on before submit event, or on the lost focus event of the quantity column in IG to execute the JavaScript code.
You can use the following JavaScript code:
Change the page items and grid columns according to your page items.
It’s work. Thanks a lot.
hii i tried it is working for me, but facing a problem when using the format mask. I am using format mask in the which i need to sum , when i am adding the value first time it appears without format mask and i could able to see the total in page item .But when i am adding second row the first row appears with format mask and it is not takin for calculation. Is there any way to take the total of column if it is having format mask.
thank you
Here I am facing a problem. When I press the tab and go to the new row, sum is reading it in Total.It doesn’t work unless i add a new one.
https://apex.oracle.com/pls/apex/saidul_abc/r/master-detail10/login?session=9701677566396
User/Pass: demo/123
You will have to call that JS code in multiple events using DA, such as got focus, lost focus or on change event of quantity column etc.
I did everything. It just works when I am pressing the enter button. But when i Pressing the tab button it does not work.Or when I click on qty or rate column with the mouse, Total is working. How can i solve this ?
https://apex.oracle.com/pls/apex/saidul_abc/r/master-detail10/login?session=9701677566396 User/Pass: demo/123
I have checked your application. You should create the two DAs on the quantity and Rate column. Select the event Change. It should work.
I also did event change but it didn’t work.
I have also created Get focus, Loss Focus DA. Didn’t work.
Let me test and will get back to you.
I have used Got Focus DA for the item I am totaling and on the page change event of the interactive grid. It is working fine for me.
I do not understand where I got into trouble. is it possible to send me test page. thank you. shimulito@gmail.com
Finaly I couldn’t do the job. Tried all the way.
I wanted, When i change Qty and rate Column (Qty*rate=Amount) then
:P4_total amount will hold Sum amount. Only Change event.
Because the formatted string is containing comma that is why it is not calculating. Below is the code in which I am replacing comma with a null value and using parseFloat() method to parse the numeric value.
hi Vinish
I did that and I got the total on Screen … OK
but how I got this value to variable or another item to make validation or so . thanks
The last line of the above code is setting the value for page item P2_TOTALAMOUNT. You can set other page items in the same way.
Thank you
How I do “COLUMN1 * COLUMN2 = COLUMN_X ” IG report
**not from SQL Query because it’s very complicated**
How I do “COLUMN1 * COLUMN2 = COLUMN_X ” IG report
Exact “:COLUMN_X :=:COLUMN1 * :COLUMN2 ; ”
**not from SQL Query because it’s very complicated**