Skip to main content
CRMSalesforce CRM

Salesforce.com – Using Process Builder Flow to create a running total of Order Sales Amount on an Account Record without Using a Rollup

By February 2, 201913 Comments

When reviewing an Account’s orders, it can be helpful to see the total amount of Orders or sales the Account has had.  By creating a custom currency field on the Account object and a flow to update the value each time an Order is completed, you can create a summary field without having to use one of the allowed Rollup fields.

Create a custom currency field:

  1. Navigate to Setup | Build | Customize | Accounts | Fields
  2. Click the New button in the Account Custom Fields & Relationship section
  3. Create a currency field with the following:
    1. Length: 16
    2. Decimal Places: 2
    3. Name and description
    4. Read Only Access
    5. Visible to all users that need to see the field value
    6. Add the custom field to current Account Layout(s)
  4. Save the new custom field

Create a Process Builder Flow to keep the summary field current:

  1. Navigate to Setup | Build | Create | Workflows & Approvals | Process Builder
  2. Click the New button in the right corner
  3. Give the process a Name and description
  4. Select “A record changes” to start the process from the drop-down list
  5. Click on + Add Object in the flow side of Process Builder

  1. Select Orders from the Object Drop Down and choose to start the process when a record is created or edited.

  1. Click Save.
  2. Click on + Add Criteria in the flow side of Process Builder.
  3. Give the criteria a name and choose Formula evaluates to true for the Executing Actions.
  4. Add the following formula to evaluate the Order Status field for the value of “Paid”
    • You can use another field and/or value by editing the formula
    • You can use a different date by editing the formula

  1. Click +Add Action under the Immediate Actions box.
  2. Give the Action a Name and choose the associated Account object as the record to be updated.
  3. Select No Criteria – Just update the records! for the criteria for updating records.
  4. Choose the field to update (e.g., the summary field on the Account).
  5. Select Formula for the Type.
  6. Add the following formula to update the summary field:
    • If you are using another order total field you can edit the formula

BLANKVALUE([Order].Account.Order_Summary_Field__c, 0) + [Order].TotalAmount

  1. Click the Save
  2. Select the Activate button in the top right corner.
  3. Test the process and make changes as needed.

Written by Becci Gearman

Corey Babka

Author Corey Babka

More posts by Corey Babka

Join the discussion 13 Comments

  • Subhash says:

    Nice blog, very interesting to read
    I have bookmarked this article page as i received good information from this.

  • Nick says:

    Can more than one summary field be created in an object?

    • Corey Babka says:

      Yes, you should be able to just repeat the same process for a separate field. This would be like having multiple roll-up fields (I think there’s a limit that way and you’re of course limited to certain objects that have that relationship). Here, because you’re using a typical field and using a process to update, you’re only limited by the number of processes (which depends on your version). Hope this helps!

  • Petrit Baralija says:

    Hi,

    thanks a lot for this article. I´m trying to rebuild this on our org, but I have problems on step 16. You´re using the field “Order_Summary_Field__c” for the formula. Do I have to create this or what kind of field is this?

    Thanks a lot. Looking forward to an answer.

    • Corey Babka says:

      Yes, it is a custom field so that would have to be created. At the top of blog, see the first section called “Create a Custom field” as we have to build the “container” first before we start populating the data. Hope that helps!

      • Petrit Baralija says:

        I see, thanks a lot for the quick help! I thought the “container” is the field “Order this year”, that you used for the formula, but I guess I have to create 2 custom fields?

        1. Order this year
        2. Order Summary Field

        or am I wrong with this ? Thanks a lot, great content!

  • Petrit Baralija says:

    I see, thanks a lot for the quick help! I thought the “container” is the field “Order this year”, that you used for the formula, but I guess I have to create 2 custom fields?

    1. Order this year
    2. Order Summary Field

    or am I wrong with this ? Thanks a lot, great content!

  • Petrit Baralija says:

    Alright, I got it now! Thanks a lot !

  • Brian says:

    I’m wondering how the following cases are handled with respect to this solution:
    1. When the order is updated and the amount is not updated, the running total should not change.
    2. When the order amount is corrected, the running total should be adjusted appropriately or recalculated.

    • Becci says:

      Hi Brian,
      Add ISCHANGED() to the criteria so that the process only ‘triggers’ when the amount is changed. This will keep any other changes to the order from causing the update and make sure when the amount is changed, the process will trigger.

      You may also need to add and OR in your trigger for when the Order is New (if you are tracking sale amounts in new orders). This would be a formula of ISNEW() && is not null.

      The complete formula would be:
      (ISNEW() && ) || ISCHANGED()

      Becci

  • Kirsten Belen says:

    Hi, thanks for this. This will be helpful. Just wanted to ask, seems that this will only sum the newly created record. What if we already have an existing records? Is there a way to sum it as well?

    • CoreyB says:

      Assuming you have set up the flow to trigger when a record is either created or edited, the solution can be pretty simple. You can add a new field in your records (limiting who can see the field if you want to avoid confusion) that will serve as a trigger to edit the existing records and get the flow to process. I would recommend you use a checkbox field. Once the field is created, you can select all your records and mass update them so that the checkbox is populated. This should result in the sums being updated in your existing records as well. Please let us know if you have any other questions.

Leave a Reply

5 Great Alternatives to SalesForce.com

Free Whitepaper Download

Learn more about 5 options that are better CRMs for small business

DOWNLOAD WHITEPAPER

Skip to content