Creating a "time stamp" card of each call logged with a contact?

I was recently asked to pull a log to show how many calls a group of 160 clients had received in the past 4 months.     I ended up going to each record to get the call information.     

I would love to have a "call time stamp card" for each contact. Every time a call is logged, that field is "stamped" and the newest call is added to the list of calls that already occurred.     

Has anyone else done this? I imagine it would involve creating a calculated custom field or a process definition, but I'm unsure of where to start.     

Thank you!!

  • Oddly enough, I build the counter field but now I'm being asked to build more of a timestamp field that would be updated each time a call is made. 


    Example: a call is logged on 9/25/2018 at 9:25 AM. 

    The log field is updated with "9/25/2018 9:25 AM". 

    Another call is logged next week, on "10/5/2018 3:38 PM" and the log is "stamped" again.

    The call log field now shows two calls, "9/25/2018 9:25 AM", "10/5/2018 3:38 PM".

    Every time a call is logged, the field would have that new time call added. 

  • Ok, let's not question the business process  though I'd be seriously tempted to do so.

    Say you are time stamping Contacts

    You can create a custom field of type textarea on the Contact, call this call_log_c

    Add an after_relationship_add logic hook on Contacts that looks something like this: 

    function update_call_log($bean,$event,$arguments) {
        global $current_user;
        //because we're in Contacts, $bean is the current Contact
        //note that relate logic hooks fire on both ends so
        //whether you just related a Contact to a Call or a Call to a Contact this will fire.

        //check if we related a Call
        if ($arguments['related_module'] == 'Calls'){
        //get the Call details by retrieving the bean
          $call = BeanFactory::retrieveBean('Calls', $arguments['related_id']);
          $date = $call->date_entered;
          //get any other details you want to add to the log.
          //prepend your new call to the existing data
          $bean->call_log_c = $date ." - " . $current_user->user_name . "\n" . $bean->call_log_c;
        } 
    }

    You could get more generic, add the hook to the Calls (instead of the Contact), verify if the module that the call was linked to has a call_log_c field and if so, update it.

    HTH

    FrancescaS

  • Hi Kayla,

    I'm a little late reading through the old postings...

    We don't have any special coding in our system.  I have done this with a new field with a calculated value that I called: "Last Call with Contact" (I have another in the Accounts Module just like it).

    The "calculation" is:  maxRelatedDate($calls,"date_entered")

    Bud Hartley | Cape Foulwind, NZ (and Oregon, USA)