1

I have a custom field completed date .this field captures all the field value when any task status changed to completed.

Totally i have 4 tasks , in which i want difference between two tasks in a formula field ... task1__c and task2__c .when both task status changed to "completed" , custom field "completed date" captures the status value .

I want difference between these two tasks when status is changed to completed.I have two different record types for these two tasks.

2
  • 2
    You cannot use values from a different record in a formula field (unless the two are related through a lookup/master-detail). It's not completely clear to me what you're trying to achieve though. Commented Mar 25, 2016 at 8:41
  • both tasks are in same custom object ..
    – anjali
    Commented Mar 25, 2016 at 14:37

2 Answers 2

0

You can relate the two tasks using a relationship and use a formula to determine the (date/number?) difference.

E.g.

IF(Status ='Complete', Task1__c.End_Date__c - End_Date__c, 0)

But, what you may want to do here is to have a trigger that considers all related tasks and updates a field on the parent task.

2
  • 1
    Thanks @sfdcweb! should have been careful about the formatting :) Commented Mar 25, 2016 at 9:29
  • thank you .... we are using this field only for report purpose so we are avoiding all those extra stuff ..... want to go in a simple way ...... so we are using in formula field
    – anjali
    Commented Mar 25, 2016 at 14:34
0

Unless you manually relate the tasks to each other, you will need to create an APEX trigger.

Alternatively, if they are so similarly related, perhaps the information could be stored on the same task? Or maybe an opportunity? I am not really sure what your goal is with this field.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .