Thanks for the video instructions. This is exactly what I need to add to Account records. However, Count field doesn't update for existing Account records unless I delete or add new contacts. How can I push this trigger for all accounts so that existing account records get the contact count?
Because when writing Parent to child relationship (i.e reaching child via Parent object), we use relationship name. Here we're trying to reach contact record(Child) in Account query (Parent), Hence we use relationship name i.e 'Contacts'
You helped me a lot because with your video I solved a similar problem that I had at my internship. Thanks. May God Bless You
Thanks for the video instructions. This is exactly what I need to add to Account records. However, Count field doesn't update for existing Account records unless I delete or add new contacts. How can I push this trigger for all accounts so that existing account records get the contact count?
In line4 if we use Set for IDs it will be better instead of List
if we change the accountId in the contact record then also it should update the contact count
ur suggestion, please
Nice mam 💥
good madam,what about contact is associated to another account update will done r not(i am not getting update)
What if we edit the contact and chage its parent account to another account then what happen in count?it is still remains same or get decrease???
Please, do count trigger on parent to child.
Line 11... select id from contacts..
Why u take contacts instead of contact?
For inner query we use contacts only it's standard object
its a relationship field name , the lookup one
why you take contacts? From where u hav taken contacts?
Because when writing Parent to child relationship (i.e reaching child via Parent object), we use relationship name. Here we're trying to reach contact record(Child) in Account query (Parent), Hence we use relationship name i.e 'Contacts'
it is relationship name
Hmm
please help. insert 500 account records with related contacts apex program