Results 1 to 3 of 3

Thread: Losing data after sort

  1. #1
    grendel67 is offline Member
    Join Date
    Aug 2009
    Posts
    17

    Default Losing data after sort

    I am trying to add the Contacts department field on the Meeting ListView. I was able to successfully get it to appear and be populated int he default listview by updating Meeting.php to pull the data and metadata\listviewdefs.php to present the data. However, when I go to sort on the new column, the updated list after sorting is empty (not just the department column - the whole list is empty). If I sort on any of the original ListView keys - contact_name for example - the data returns.

    What needs to be tweaked so I can sort on the new column?

  2. #2
    letrium is offline Sugar Community Member
    Join Date
    Dec 2008
    Posts
    614

    Default Re: Losing data after sort

    Hi

    I don't know the simple fix for this problem.

    You can do this field no sortable.
    Just edit ../modules/Meetings/metadata/editviewdefs.php


    'PARENT_NAME' => array(
    'width' => '20',
    'label' => 'LBL_LIST_RELATED_TO',
    'link' => true,
    'default' => true,
    'sortable' => false,
    ),

  3. #3
    grendel67 is offline Member
    Join Date
    Aug 2009
    Posts
    17

    Default Re: Losing data after sort

    I tried that with no change. I found some help here - http://www.sugarcrm.com/forums/showthread.php?t=29624. Specifically, I added the following to Meeting.php to add phone # and department from the Contacts.:

    Code:
      function create_new_list_query($order_by, $where,$filter=array(),$params=array(), $show_deleted = 0,$join_type='', $return_array = false,$parentbean, $singleSelect = false) {
                    $ret_arr = parent::create_new_list_query($order_by, $where,$filter,$params, $show_deleted,$join_type, true, $parentbean, $singleSelect);
                    if (strpos($order_by, 'contact_phone') !== false) {
                            $ret_arr['order_by'] = ' ORDER BY contacts.phone_work '.(strpos($order_by, 'ASC') === false ? ' DESC' : ' ASC');
                    } else if (strpos($order_by, 'contact_department') !== false) {
                            $ret_arr['order_by'] = ' ORDER BY contacts.department '.(strpos($order_by, 'ASC') === false ? ' DESC' : ' ASC');
                    }
                    return $ret_arr;
            }
    Unfortunately, this doesn't extend to search capability so I have a new item to research.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Missing data on sort
    By grendel67 in forum Developer Help
    Replies: 0
    Last Post: 2009-09-16, 06:44 PM
  2. SugarCRM 5.0 losing attachments
    By WScarboro in forum Help
    Replies: 14
    Last Post: 2008-09-03, 10:44 AM
  3. Losing Values
    By sacramentojoe in forum Help
    Replies: 0
    Last Post: 2006-09-06, 01:14 AM
  4. Replies: 5
    Last Post: 2005-12-06, 01:01 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
  •