1

I need to create a custom field on my Contact object that records the date of the very first call that has happened with a Contact record.

I thought about creating a formula field on Contact, and then somehow entering the date of the first call. Not sure how to go about it though. Any ideas how to do that, or better solutions?

3 Answers 3

0

If you're going to set up that value manually, a formula field is not required-- a simple date field can be used. Head to Setup/Customize/Contact/Fields, click on new under "Custom Fields and Relationships". Select "Date", follow the steps to finish adding the field to Contact.

2
  • I want this to happen automatically. This field should be populated as soon as someone clicked "closed" on the first call made
    – Lily
    Nov 5, 2014 at 14:53
  • 1
    In that case you'll need to use an Apex Trigger in order to set that logic. You can create triggers on the Task object, and check all the conditions there to set the Contact field value. Nov 5, 2014 at 18:22
0

You can write a before update trigger on contact.

In that, you can compare created date and last modified date for new updated instance if that is same,you can update current date in you field. It is like only when the record is created, created and last modified date is same.

Pseudocode:

trigger UpdateLAstModifiedDate on Contact__c (before update) {
    
    for(Contact__c c:Trigger.new){
        if(c.creteddate==c.lastmodifieddate){
            c.sample_Date__c=system.today();
        }
    }
}

Thanks,

-1

If you need to keep the date of the first time the contact got a call and this first call is related to the "Closed" value that someone is selecting from a dropdown field or from a tick box, I thing that the best option is to use a workflow rule. Lest say that the parameter value "Closed" is a checkbox. This check box is uncheck and when someone makes a call he or she will tick the "Closed" check box. After this is done a workflow will set a date on a date data type field. This is the most simple way to do it. Create one field for the "Closed" parameter and a Date data type field with the name "First Call Date".

Then you create a Workflow rule that will update the "First Call Date" if the "Closed" tick box is check. The value you need to add is a formula to on the "First Call Date", this one: TODAY().

That will set your "First Call Date" value to the day in which the "Closed" checkbox was check. Make sure you make your new Workflow rule active.

0

You must log in to answer this question.

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