You need to sign in to do that
Don't have an account?
naresh
2 objects acount and custom object task which is look up to account
There are 2 objects acount and custom object task which is look up to account and parent acount is having a custom filed number type as 'no of task child records'. And when ever i insert a record in task object the number should populate in account custom filed 'no of task child records'. If task object is having 10 records den account custom field must show as a number 10. Please suggest me how to achieve this.
Thank in advance.
Thank in advance.
As you can define them on any standard object that is on the master side of a master-detail relationship with a custom object, I think the best way is to use a roll-up summary field with type "Count".
Hope this helps,
Fred
Thanks for ur reply.If it is master relationship then we can use roll-up summary. But howto do it if it is a lookup relationship.??
For lookup relationship you've to deal with trigger. You'll find many examples here http://salesforce.stackexchange.com/questions/33650/how-to-write-a-rollup-summary-trigger-for-a-lookup-relationship or here http://blog.jeffdouglas.com/2009/07/30/roll-up-summary-fields-with-lookup-relationships-part-1/.
There is also the declarative way https://developer.salesforce.com/page/Declarative_Rollup_Summary_Tool_for_Force.com_Lookup_Relationships which can be convenient.
Regards,
Fred