You need to sign in to do that
Don't have an account?
Sain
I have to count a child records on parent object by using trigger
Hi All,
I have a two objects like doctor(parent) and patient(child), my scenario is i have to count a child records on parent object by using trigger.
(using rollup summary we can achieve this but i have to achieve with trigger)
please any one help me with code for this scenario.
Thanks in advance!!!
I have a two objects like doctor(parent) and patient(child), my scenario is i have to count a child records on parent object by using trigger.
(using rollup summary we can achieve this but i have to achieve with trigger)
please any one help me with code for this scenario.
Thanks in advance!!!
Very curious requirement. To do this I am making the assumption that you have a field defined on the parent to hold the count. In general, it would go something like this:
you can refer below code:
Replace API names with your Object and field API name.
If this solves your problem, kindly mark it as the best answer.
Thanks,
Vatsal
Lookup relationship.
what to do