On Delivery note Line Item , I have the field Delivered_Quantity__c ( number type ) and , I 'd like to record the total number of this field for each items . So the idea is I create a new field called (Total Delivered ) which is the sum of Delivered Quantity for all delivery notes .

the formula is like this :

Total Delivered += Delivered_Quantity__c

do you know how to do that when we enter formula ??

I tried but error

+= Delivered_Quantity__c

thanks in advance

3 Answers 3


You can create a new custom field on your Delivery note of the type Roll-Up Summary.

That field displays the sum, minimum, or maximum value of a field in a related list or the record count of all records listed in a related list.

See: https://help.salesforce.com/HTViewHelpDoc?id=fields_about_roll_up_summary_fields.htm

  • yes , but the problem is the type roll-um summary concern the total of Delivery note ( for all Items ) . if we have 3 items : Item 1 , Item 2 and Item 3 I would like to know how many we are already delivered for the Item 1 . the same thing for Item 2 etc ... for all Delivery notes Jul 13, 2015 at 11:46
  • How many different items do you have? If it is only a few, than you could create a roll up summary for each. You can then filter each roll up summary for the specific item. If you have many, then it depends on your use case. Maybe a raport would work better.
    – Kasper
    Jul 13, 2015 at 12:51

I don't understand what you want to do exactly, but I think you want to sum only certain items and not all items. Anyway, you cannot achieve that with a formula field. You have two options here: a rollup-summary field on the master object, or a trigger that updates a custom field on the master object each time there is an insert/update/delete in the child object. But in most cases, a roll-up summary should be sufficient.

  • Hi , I mean if we have a rollup summary field based on Delivered_Quantity on parent ( Sales Order ) the result is total delivered for all Items (Item 1 , Item 2 , Item 3 ) . My question is : it is possible to use a rollup summary field for each rows ??? Jul 13, 2015 at 12:21
  • Can you explain more please? What do you mean by "it is possible to use a rollup summary field for each rows ?". Can you give a simple example with numbers so we can help you? Thanks. Jul 13, 2015 at 12:29
  • Hi , please , you can find the link zupimages.net/viewer.php?id=15/29/2w01.png just to make it clear . Jul 13, 2015 at 13:13
  • Thanks for the clarification. Is there a master-detail relationship between Sales Order Line Items (parent) and Delivery Notes (child)? If yes, easy, you make a rollup summary field on the parent object (Sales Order Line Item). If not, you have to write an Apex Trigger. Each time you insert, update or delete a Delivery Note object, your trigger looks for a corresponding item in Sales Order Line Items and does the appropriate calculation. If you're a developer, I guess that might be easy for you. If not, you will have to get in touch with a developer and get the job done. Jul 13, 2015 at 14:30

just create a roll up summary field and specify condition i.e., Sum of the field and condition is status is delivered like , it will give you only delivered items total ...you can see my screen as below: enter image description here

You must log in to answer this question.

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