Sean Foster
Email me

13 · Energy

Asset counts across a whole account tree

Business units needed to see a customer's installed base across its whole corporate family, not one account at a time. I built rollups that walk the account hierarchy in batch and queued Apex, keep the counts current, and stop safely when the data loops back on itself.

Client
Builds power and grid equipment for utilities worldwide
Built with
  • Salesforce
  • Apex
  • Batch Apex
  • Queueable Apex

What it changed

  1. 01

    Asset counts roll up through every level of a customer's account tree, for 5 business units.

  2. 02

    The walk runs in batch and queued Apex, so deep hierarchies stay inside platform limits.

  3. 03

    Circular parent-child links are caught, so a bad hierarchy can't loop forever.

How it fits together

  • Built by me
  • Platform or outside system
  • People
AssetsInstalled equipmentRollup jobsBatch and queued ApexHierarchy walkerRecursive, loop-safeAccount treeCounts at every levelBusiness units5 of themAsset changesRoll upTheir own countsAssetsInstalled equipmentRollup jobsBatch and queuedApexHierarchywalkerAccount treeCounts at everylevelBusiness units5 of themAsset changesRoll up

More of my work

See all

Contact

Need something like this built?

I take on full-time roles and focused projects. Email is the fastest way to reach me.