You need to sign in to do that
Don't have an account?
pradeepkumar batta
Hi every one,
i have requirement for update grand parent field update when update happens in grand child object .how can we achieve this .
The object like A (grand parent) ,B (parent) ,C(grand child)
Please suggest me.
Update grand parent field with grand child
Hi every one,
i have requirement for update grand parent field update when update happens in grand child object .how can we achieve this .
The object like A (grand parent) ,B (parent) ,C(grand child)
Please suggest me.
Please find below a sample code for your requirement :
Let me know if you need any help or clarification.
Regards,
Abhishek
Did you use the Set<> command rather than the List<> command to avoid duplicate retruns from the Select query?
Thanks
Dan Broussard
I've 3 objects:Parent__c,Children__c,GrandChild__c. In Parent object I've 2 fields Number_of_Children__c,Number_of_Grand_Children__c in Parent__c .
In Number_of_Children__c field I want to have the count of Children__c for the specific parent,I'm able to achieve this
For Number_of_Grand_Children__cI I need to have count of the GrandChild__c. I'm unable to achieve this
For Example:
I have a record for Parent__c, I've created 2 Children__c records let's say Child1 and Child2 and now Number_of_Children__c field will have the value=2.Further I drill down and create 2 child records each under Child1 and Child2, then I need to populate the field Number_of_Grand_Children__c=4.
Please let me know if anyone can help me in this via trigger/ any apex means.
PS:Do not suggest declaration approach,it can be achieved via declaration