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
BpositiveBpositive 

Calculation Query

I am new to Apex developement. I have a page where there are three lookups.

I want to extract price of each lookup selected, multiply by quantity which I enter and add all of them to get Total cost.

 

Please help me on how can I achieve this.

 

Thank you

 

~VK

Best Answer chosen by Admin (Salesforce Developers) 
BpositiveBpositive
It is a normal page not a visual force page. Please let me know the details about how I can create a formula field.. Thank you ~VK

All Answers

SamuelDeRyckeSamuelDeRycke

The answer depends a bit on where you're trying to do this. On a record detail page, or a visualforce page.  If all 3 lookups and the quantity field are fields on your object, you could make a forumla field with the name Total cost, without the need to write any code.

 

If you're working on a visualforce page, you may need to give us more info if you want a specific answer to your case.

 

 

 

BpositiveBpositive
It is a normal page not a visual force page. Please let me know the details about how I can create a formula field.. Thank you ~VK
This was selected as the best answer
BpositiveBpositive

Thank you very much. Appreciated. I figured out how to do it.

 

~VK