You need to sign in to do that
Don't have an account?

Summarising data on a parent account
Hello,
Does anyone know if it is possible to summarise data on a parent account from the accounts in its hierarchy. I know how to do this on an account from any child objects on that account, but can't find away to summarise information a the parent account level in relation to the accounts in its hierarchy.
An example would be that each account has a monthly revenue field, the monthly revenue field on the parent account should be the sum of the monthly revenue fields on all the account below it in the hierarchy?
Any help appreciated.
Kirsty
The Parent field on Account is a reference to the Parent Account.
Therefore you can use
Select Id, Name from Account where ParentId = '....'
to return all the children account of a Parent
All Answers
Hey,
Rollup Summary Fields can do that for you in a Master-Detail relationship, but since Account hierarchies are self reference relationships, don't reckon its possible.
This idea thread also seems to suggest this
http://success.salesforce.com/ideaView?id=08730000000BrqGAAS
Which means, if you want to do this, it will have to be an Apex Trigger, rather than config.
Thanks for your reply Ritesh. I've promoted the idea of making it out of the box.
I've used rollup summary fields for master-detail relationships before and I know how to reference a parent account on a child account via a trigger, but I don't know how to reference the child account on the parent account in APEX.
Do you have any of the syntax for that?
Regards
Kirsty
The Parent field on Account is a reference to the Parent Account.
Therefore you can use
Select Id, Name from Account where ParentId = '....'
to return all the children account of a Parent