You need to sign in to do that
Don't have an account?
Saurav nirwal 21
trigger of account
User created a new Field in Account (Parent Account) as a lookup.
So now he wants to managing child counts so create a new field of type number (childCount).
Create a trigger to update childCount accordingly.
:: Trigger on After Insert,After delete,Affter update
So now he wants to managing child counts so create a new field of type number (childCount).
Create a trigger to update childCount accordingly.
:: Trigger on After Insert,After delete,Affter update
You can utilize the below sample trigger model and change the field names and object name according to your code.
The below trigger model based on Parent(Account) and Child(Contact).
Let me know if it helps.!
Arun is right if you want to count the contact related to Account .As per your statement what I think you need to count the Child account related to Parent Account if we make relationship through the ParentAccount self lookup field .
Try with below code check the ChildCount field API name and the ParentAccount also .If you have created any custom field for lookup then chage with ParentId .
Let me know if it helps !!
Thanks
Manoj