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
TK1234TK1234 

Self relationship in an object and get the count of child records from related list

Hi Experts,

I have an object ( say Account) and defined a self relationship Account object which is 1 parent Account can have multiple child Accounts.

Now I have to get the count of child objects  from  the related list and update the count in parent... how to do achieve this?

Appreciate your inputs...

 
Arunkumar RArunkumar R
Hi,

You definitely need to write a custom code using apex trigger.

Please refer the below blog it may help you.

http://salesforcekings.blogspot.in/2015/07/rollup-summar-trigger-for-lookup.html
TK1234TK1234
Hi... I am how to query the relates list if  parent and child are of same object... 
TK1234TK1234
eg : Account 1 is parent which is related with Account2,Account3,Account4 child object.....if any change in child object... the field should be updated in PARENT