function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chandra babu 2Chandra babu 2 

how to sum two columns fields and display the value another column

Amount   :
Discount :

Net price :

In the UI page  i will give amount value and Discount value .so these two values add and  Display directly   show on  UI page.please tel me.
Rohini AherRohini Aher
Hi Chandra, 

You can achieve this using Javascript or action function. Using javascript(document.getElementById for both amopunt and discount) you can get the values in script and then calculate in script itself and again using document.getelementById you can assign that value to net price.

And using action you can do all operations in apex class and assign the value to Net price variable  and then you can rerender the Net price  column  to show refreshed values. 

Hope this helps you!

Chandra babu 2Chandra babu 2
please tel me hoewto write the code in class and page
Hemali PatelHemali Patel
you can achieve it using wrapper class .