Results 1 to 4 of 4

Thread: Filtering contact records by details held against the associated account

  1. #1
    realtimedespatch is offline Junior Member
    Join Date
    Oct 2007
    Posts
    3

    Question Filtering contact records by details held against the associated account

    Can anyone suggest a way to list sugar contacts by account type (accounts.account_type) ?

    It's such a simple requirement that I suspect it's possible from within the Sugar screens but I can't figure it out.

    My immediate requirement is to provide my users with a mechanism to export the email addresses for all Sugar contacts that are associated with a particular Account Type.

    The statement below shows the kind of association I'm trying to make

    Code:
    SELECT
    	a.name,
    	a.account_type,
    	c.first_name,
    	c.last_name,
    	em.email_address
    FROM accounts a
    JOIN accounts_contacts ac ON ac.account_id=a.id
    JOIN contacts c ON c.id=ac.contact_id
    JOIN email_addr_bean_rel xr ON xr.bean_id=c.id
    JOIN email_addresses em ON em.id=xr.email_address_id
    WHERE account_type LIKE 'SWHouse'
    ORDER BY a.name
    More generally, I'd like my users to be able to apply the same "Account Type" filter to the advanced search screen when searching through contacts.

    Is this something that can be done within the standard UI ?

    Thanks for any suggestions.

    Charlie


    Version 5.1.0b (Build 4905)
    Debian Etch
    MySQL 5.0.32

  2. #2
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Filtering contact records by details held against the associated account

    Charlie,

    I've created a custom field type that you can add to the advanced search to search on related module information such as account_type. I'll clean it up this weekend and will let you know when it's available.

  3. #3
    realtimedespatch is offline Junior Member
    Join Date
    Oct 2007
    Posts
    3

    Default Re: Filtering contact records by details held against the associated account

    Wonderful, thank you

  4. #4
    realtimedespatch is offline Junior Member
    Join Date
    Oct 2007
    Posts
    3

    Default Re: Filtering contact records by details held against the associated account

    Eggsurplus

    Thank you again for such a polished solution, it's working beautifully.


    Charlie

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Contact information filtering
    By sorriluis in forum Help
    Replies: 0
    Last Post: 2008-04-01, 09:41 PM
  2. Replies: 2
    Last Post: 2007-01-29, 04:11 PM
  3. Email contact details to someone
    By Proware in forum Help
    Replies: 0
    Last Post: 2006-08-21, 04:38 AM
  4. Missing Contact Details
    By jackwhittaker2000 in forum Help
    Replies: 1
    Last Post: 2006-05-24, 08:23 AM
  5. History record hover over like 4.0 account details
    By atheimer98 in forum Classifieds
    Replies: 0
    Last Post: 2006-03-16, 03:54 PM

Tags for this Thread

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
  •