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
TristanALTristanAL 

Update parent account's field with child account data

Hi Guys

 

I am stuck with what may be a newbie question...

 

My organization uses two differents types of Account: "ship_to" and "bill_to" accounts. Each ship_to account is necessarly linked (with the hierarchy tree) to a bill_to account. So there is a parent-child relationship.

 

For each account (either bill_to or ship_to) there is a field with number values - let's call it "Number of cars".

 

==> Now I would like to summarize the number of cars for a same customer, which means I need to sum the field "Number of cars" for the parent.account and ALL the child accounds. The sum would be displayed in the parent.account page layout.

 

How could I do?

 

Thx

Tristan

 

Josephadm401Josephadm401

The only way to do this would be through reporting. Create a report on accounts that pulls only accounts with a specific parent account value. You could then create a custom button if you like on the account page layout that would allow you to go directly to a report based on which account you are currently on and it would make it apart of the filtered criteria. Let me know if you would like this type of button.

Andy BoettcherAndy Boettcher

You could do this via an APEX trigger on the Account field.  If you're interested in expanding on the possibility, let me know and I can help you lay out some code.

 

-Andy