• #20498
     Nibedita Dey #84
    Forcetalks

    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
    Forcetalks

    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
    Salesforce | Sudhir Sudhir #22
    Forcetalks

    Click to get to the code: TaskRollUpOnContact

    Hope it helps!

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

Please 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

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

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

Log in with your credentials

or    

Forgot your details?