Results 1 to 3 of 3

Thread: No email field for Account & Cases listview

  1. #1
    jason.bazalar is offline Junior Member
    Join Date
    Dec 2007
    Posts
    3

    Default No email field for Account & Cases listview

    Hello all,

    I am working the the Accounts and Cases modules and would like to get the emails within each record to show on the listview of each one. I tried to stick with Studio to allow this, but I don't see the field for email so I can add it to the listview.

    The Accounts dashlet let's me add in the email field in it's list view but is empty for records where I have entered an email address.

    Additionally, how do I get these emails to come out in the "export" list?

    Currently using: Sugar Community Edition Version 5.0.0d (Build 3235) [normal setup]

    Any help would be appreciated.

    Jason B.
    Last edited by jason.bazalar; 2008-05-06 at 12:53 AM.

  2. #2
    jason.bazalar is offline Junior Member
    Join Date
    Dec 2007
    Posts
    3

    Default Re: No email field for Account & Cases listview

    I did the following to display the email in the custom email field I created and in the email field in the dashlet:

    TO VIEW EMAILS IN ACCOUNTS:
    1. {crm_install}/modules/Accounts/Account.php
    In the get_list_view_data() function:
    ----
    $temp_array['EMAIL1'] = $this->emailAddress->getPrimaryAddress($this);
    ----

    2.Added a custom field called email, labeled LBL_EMAIL in studio under Accounts. Made this field viewable in listview. Saved and deployed.

    3. {crm_install}/custom/modules/Accounts/metadata/listviewdefs.php
    Added customCode line to the Email bracket.
    ----
    'EMAIL_C' =>
    array (
    'width' => '10',
    'label' => 'LBL_EMAIL',
    'customCode' => '{$EMAIL1}',
    'sortable' => true,
    'default' => true,
    ),
    ----

    But this doesn't allow the emails to be sorted correctly, it was just a quick way I found to get the data shown. Plus, the most important part is getting the emails as part of the export feature. Any recommendations?

  3. #3
    jason.bazalar is offline Junior Member
    Join Date
    Dec 2007
    Posts
    3

    Default Re: No email field for Account & Cases listview

    Here's what I modified to get the emails to show up along with the other data when clicking the 'export' button the the Accounts ListView page.

    1. {CRM_INSTALL}/modules/Accounts/Account.php
    In the create_export_query() function:

    function create_export_query(&$order_by, &$where)
    {
    ...
    $query = "SELECT

    /* START ADDED */
    accounts.*,email_addresses.email_address,
    /* END ADDED */

    users.user_name as assigned_user_name ";
    ...
    $query .= " LEFT JOIN users
    ON accounts.assigned_user_id=users.id ";

    /* START ADDED */
    $query .= ' LEFT JOIN email_addr_bean_rel on accounts.id = email_addr_bean_rel.bean_id and email_addr_bean_rel.bean_module=\'Accounts\' and email_addr_bean_rel.primary_address=1 ';
    $query .= ' LEFT JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id ' ;
    /* END ADDED */

    $where_auto = " accounts.deleted=0 ";
    ...
    }

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. email marketing feature requests
    By maxsutter in forum Feature Requests
    Replies: 1
    Last Post: 2008-10-11, 10:19 AM
  2. Replies: 4
    Last Post: 2008-03-24, 02:50 PM
  3. Cases and Email relationship
    By rvarghese in forum Developer Help
    Replies: 3
    Last Post: 2007-08-30, 02:07 AM
  4. Replies: 1
    Last Post: 2007-02-21, 11:42 AM
  5. Contacts ListView - Email Addresses
    By clyons in forum Developer Help
    Replies: 0
    Last Post: 2005-02-10, 08:59 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
  •