I am having a product object where there are price field in it. Product has a lookup to product and if I select the product I need to generate price field automatically in text box. And there is another field named Quantity where I want to add a formula field by multiplying price* quantity to update price in second step and I want to add a total field I will update there. How can I autopopulate fields based on product selected and update price field.

2 Answers 2


You have two options:

Option 1

Use a formula field to pull in the looked up to product's price * the entered quantity to display the total price. This would look something like this:

Field type = Formula (currency) | Name = Total Price

Product.Quantity__c * Product__r.Price__c

Option 2

Alternatively if you need the ability to override the Price before the total is calculated you will want to do this:

Create a Currency field called Price and write a workflow rule to fire everytime the record is created/edited and set the criteria using a formula

OR(IsChanged(Product__c), ISNUll(Price__c)

Set the rule to be a field update | update the Price__c field to Product__r.Price__c

then create the total price formula

Field type = Formula (currency) | Name = Total Price

Product.Quantity__c * Product.Price__c

I recommend you work through the warehouse tutorials found in the Force.com Workbook. It should provide you with all the learning tools and references needed to figure out how to do what you're asking.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .