Is there a way to configure a trigger such that when a new activity (call, meeting, task, note, etc.) is added in relation to another record (i.e. an opportunity record) the Date Modified on the related/parent (opportunity record) changes?

I'd like to find a way to change the Date Modified on an (opportunity/organization/client contact, etc.) record when an associated activity (specifically: call, note, meeting, task) is added and tied back to the (opportunity/organization/client contact).  Is this feasible? 

This would help with reporting - i.e. tracking stagnant opportunities.  In this scenario, perhaps nothing on the opportunity record itself changes, but a new call, or meeting has been logged so progress is being made behind the scenes.  If I could change the date modified on the actual opportunity record (only if the note, call, etc. has been tied to an opportunity or otherwise - I do realize they can be created independently), it'd be helpful!  

Parents
  • Jupp, quite easy.

    Add a field to each module you want to track like this:

    Most important is the default value because it is added on create.

    On my try I added the same field on meetings and calls:

    Now go to opps and add:

    With this formula (add more fields from additional modules as you wish)

    add(rollupSum($calls,"count_c"),rollupSum($meetings,"count_c"))

    Formula causes that every change on a related activity will change the date modified of the opp... but I assume this is what you want because you presumably need to track changens on anything that happens to the opp.

    Edit for other people looking for a solution: This formular works if you want to update the modified date on create of an activity only. For all updates see below

    Worked fine on my test. (SugarCRM 8.3 ENT)

    Bests

    Björn Canales Pfisterer

    Technical Support Manager

    provalida GmbH

Reply
  • Jupp, quite easy.

    Add a field to each module you want to track like this:

    Most important is the default value because it is added on create.

    On my try I added the same field on meetings and calls:

    Now go to opps and add:

    With this formula (add more fields from additional modules as you wish)

    add(rollupSum($calls,"count_c"),rollupSum($meetings,"count_c"))

    Formula causes that every change on a related activity will change the date modified of the opp... but I assume this is what you want because you presumably need to track changens on anything that happens to the opp.

    Edit for other people looking for a solution: This formular works if you want to update the modified date on create of an activity only. For all updates see below

    Worked fine on my test. (SugarCRM 8.3 ENT)

    Bests

    Björn Canales Pfisterer

    Technical Support Manager

    provalida GmbH

Children
  • Thanks for the response.  This works, but only when a new activity is CREATED.  If I go back in and update my note, task, meeting, call, etc. it does not update the date modified.  I need it to update the date modified both when an activity is created an also when an activity record is updated. 

  • Hi Emily,

    I had a similar desire - I wanted to count the calls (and emails) sent to a Contact and to an Account along with the Date of the last Call or email.

    In those modules (Accounts and Contacts) I added two fields for each - the number and the date of the last one:

    Number of Calls

    Last Call

    Number of emails

    Last email

    For the "Number of" fields I use the formula: count($calls)

    For the "Last" fields I use the formula: maxRelatedDate($calls,"date_entered")

    Also, opening and saving (or at the next change) both fields update.

    It works for me!

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