Results 1 to 5 of 5

Thread: Sort by Last History Entered

  1. #1
    leemoney24 is offline Sugar Community Member
    Join Date
    Feb 2006
    Posts
    56

    Default Sort by Last History Entered

    Hello,

    I was wondering if anyone knew if it was possible to display the "Last History" date. For instance, i have all my opportunities lined up...but I don't know which ones i've contacted lately until i open each one up and determine when my last email, phone call, etc. was.

    If I could display the "Last History Date" and sort, that would be fabulous. More specifically, its the modified date of the last History entry for the selected opportunity.

    I'm using 5.1.0b and Community Edition.

    Leland

    p.s. thank you SugarCRM
    Last edited by leemoney24; 2008-11-10 at 10:27 PM.

  2. #2
    roblaus's Avatar
    roblaus is offline Sugar Community Member
    Join Date
    Dec 2006
    Location
    Vienna / Austria
    Posts
    2,850

    Default Re: Sort by Last History Entered

    Unfortunately there is no easy way in CE. The reason is that different activity types reside in different tables and are brought together "artificially" through a function.
    Your best bet is a small fix that fills a (new) date field "last contact" on the opportunity each time a related activity is created/updated. Not a big deal.
    __________________________
    Robert Laussegger
    http://www.iscongroup.net

    Bei Fragen: support@iscon.at
    Die deutschen Sprachdateien für SugarCRM und das deutsche Handbuch gibt es hier: http://goo.gl/kPsAz
    Ab sofort auch mit 6.4.2

  3. #3
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Sort by Last History Entered

    Hi Leland

    You can do the following:

    1. Create an extended vardefs for Opportunities: custom/Extension/modules/Opportunities/Ext/Vardefs/vardefs.ext.php
    Inside this file you can define the field last_history_date (date, non-db, just like date_closed);
    2. Go to Admin -> Repair -> Rebuild Extension
    3. Create a logic_hook process_record for Opportunities where you will fill in this field which the earlier history date.

    This suggestion is easy to do but it will make the Opportunities ListView a bit slow because for each Opportunity record SugarCRm will need to process the last_history_date.

    There is another suggestions which will not affect the Opportunities ListView performance but will require more customization:
    1. Create a custom field into Opportunities (last_history_date, date)
    2. Create a logic_hook before_save for all modules under History Subpanel
    This logic_hook will check if this record is related to a Opportunity, if yes it retrieves the Opportunity and update the last_history_date.

    That is it.

    Regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  4. #4
    leemoney24 is offline Sugar Community Member
    Join Date
    Feb 2006
    Posts
    56

    Default Re: Sort by Last History Entered

    gentleman, thank you for giving me some good ideas to consider. would a custom module be appropriate for something like you have suggested? I haven't investigated the custom modules much.

    Leland

  5. #5
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Sort by Last History Entered

    Hi Leland

    Lets focus on Option 2:

    There is another suggestions which will not affect the Opportunities ListView performance but will require more customization:
    1. Create a custom field into Opportunities (last_history_date, date)
    2. Create a logic_hook before_save for all modules under History Subpanel
    This logic_hook will check if this record is related to a Opportunity, if yes it retrieves the Opportunity and update the last_history_date.

    For a custom module, you may either create a custom field, if you don't know how to create a field into vardefs, or create a field directly on vardefs.

    All other tasks are the same.
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. History Subpanel- Sort by Date Sent/Received
    By peteunderwood in forum General Discussion
    Replies: 15
    Last Post: 2010-01-20, 07:12 AM
  2. History Sort Order
    By andreasw in forum Help
    Replies: 10
    Last Post: 2005-10-22, 11:13 AM
  3. Bug is Sort Order of History Items
    By trueblade in forum General Discussion
    Replies: 0
    Last Post: 2005-07-25, 03:38 PM
  4. Replies: 2
    Last Post: 2005-05-18, 11:59 AM
  5. History: Sort by creation date
    By borton in forum Feature Requests
    Replies: 0
    Last Post: 2004-10-19, 11:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •