• #20498
     Nibedita Dey #67

    How can i write a Salesforce trigger to count number of completed task in a single contact?

    how can i write a trigger to count number of completed task in a single contact?

    Tagged: ,

    #20499

    I have completed this question till creating a task related with account.and count function is not completed,how can i do this.code is here

    trigger copleteTask on Account (after insert)
    {
    List lst= new List();
    for (account acc : trigger.new)
    {
    Task t = new Task();
    t.status = ‘complited’;
    t.WhatId = acc.id;

    lst.add(t);
    }

    if (lst.size() > 0) {
    insert lst;
    }
    }

    #20553
    Profile photo of Sudhir Sudhir #5

    Click to get to the code: TaskRollUpOnContact

    Hope it helps!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending
Property of Forcetalks.com
Copyright 2017 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?