+ Start a Discussion
Laura BrewerLaura Brewer 

task roll up summary to custom object

I've create a custom currency field on the Task object called "Cost".  I'd like to have that "Cost" field roll-up and summararize at the parent object which is a custom object.  Roll-Up summaries won't work here.  Anyone have another idea how I might accomplish this?
mili jacobmili jacob
The roll up summary fields are only for master detail relationship and could do with custom objects in most cases and if in your case it is not work you can use the app in which there is a roll up helper. 

buy dissertation online (http://best-essay-writing-service-reviews.com/points-noted-buy-dissertation-online)
buggs sfdcbuggs sfdc
Yes if you have a master-detail relationship between the task and other object you can configure it but creating a rollup-summary on it,the other you have to customize it through apex code,here i can give you the sample code just follow and implement it.
trigger CountContactsnew on Contact (after insert, after delete, after undelete) {

    List<id> accIdList = new List<id>();
    if(Trigger.isInsert || Trigger.isUndelete){
        For(Contact con1 : Trigger.new){
        For(Contact con1 : Trigger.old){
    List<Account> accUpdateList = new List<Account>();
    For(Account acc : [SELECT NoOfContacts__C,(SELECT id FROM Contacts) FROM Account WHERE id =: accIdList]){
        acc.NoOfContacts__C = acc.Contacts.size();
        update accUpdateList;
    }Catch(Exception e){
        System.debug('Exception :'+e.getMessage());
And some sample links which may helps you out

https://github.com/abhinavguptas/Salesforce-Lookup-Rollup-Summaries The above link from Abhinav solves your problem If you need for more than one object would recommend to try the excellent tool from Andrew http://andyinthecloud.com/2013/07/07/new-tool-declarative-rollups-for-lookups/ And if you have requirement for only one object ,you can prefer jeff solution as well http://blog.jeffdouglas.com/2009/07/30/roll-up-summary-fields-with-lookup-relationships-part-1/

Let me know if you have any issues.

Mark it as best answer if it works.

Susan Harris 6Susan Harris 6
@Mili, thank you for recommending Rollup Helper. It can be installed free from the AppExchange: http://goo.gl/CqJrtH