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
SlanganSlangan 

Create total by adding up a field on multiple line-items

Hi Everyone,

 

First I would like to thank everyone here for all of their help and patience. This is a truly wonderful group and I am very grateful for all of the fabulous programmers who help people like me out when we need it. We would be lost without you!

 

Now - I hope I can impose upon you all for some of your much-needed input...(please):

 

We have created a special field called ERP Cost which is in the product card. We want to use this cost minus the sales price to come up with a margin calculation. This all works very well. The problem is that we want to tally up the margins from each line item in an opportunity and use that to give us a grand total 'Margin' on the opportunity. I am totally stumped on how to create totals by adding up a field on multiple line items.

 

Can anyone help point me in the right direction?

 

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
CaffeineCaffeine
It sounds like you need a Roll-up Summary Field.  In Salesforce Help, do a search on 'Roll-up Summary Field' and that should get you what you're looking for.  If you have further questions, just post back.

All Answers

CaffeineCaffeine
It sounds like you need a Roll-up Summary Field.  In Salesforce Help, do a search on 'Roll-up Summary Field' and that should get you what you're looking for.  If you have further questions, just post back.
This was selected as the best answer
SlanganSlangan

Thank-you very much for both your speedy and very useful answer.

 

 

Once again, I am humbled by the awesomeness of the SalesForce community.

 

 

Cheers!

Shannon