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
Bethany FaganBethany Fagan 

Sum of a custom field

Does anyone have a code or formula that would total/sum a custom field on each individual quote line item. 

For example, I have a quote and I need to know the the total sales price plus the total promotional value of each line item of the quote. Can I add them at the quote line item level? If so how would I do this? Or is there a formula that would some the total? 
Krishna SambarajuKrishna Sambaraju
You can add a Roll-up Summary field on Quote which can sum up values of the Quote Line Items. You can also filter the Quote Line Items to be used in the sum up.
Bethany FaganBethany Fagan
Krishna-

But that is only summing either the total sales price or the total promotion value. I'm looking to find a way to total both. And I thought about creating a custom field that adds promo value and subtotal or total price, but I noticed on our quote that the subtotal and total price are equaling the same. Any thoughts? 

Thanks!
Arunkumar RArunkumar R
Hi Bethany,

Step 1: Create formula field on Quote Line Item object and selec return type as currency.
Step 2: In your forumual editor give as UnitPrice +  Your_CustomfieldApiName
Step 3: Ensure Treat blank fields as zeroes selected at the bottom of the page.
Step 4: Now create Rollup summary field on quote object, then select sum.
Step 5: In field to aggregate option select the above newly created formula field.

Subtotal and Total price is different. 

Total Price = Quantity * salesprice
Sub Total = Total price exclude of discount percent.
Tim Britton 3Tim Britton 3
Bethany, my newly created custom formula field does nos show up as an option on the picklist.  Any ideas?