Results 1 to 3 of 3

Thread: query Contacts based on date field in Opportunities module?

  1. #1
    TedErnst is offline Member
    Join Date
    Jun 2008
    Posts
    8

    Question query Contacts based on date field in Opportunities module?

    I would like to create a target list of Contacts (I'll export and then import back as Targets, unless you have a better idea.) based on a date field in the Opportunities module. Can this be done? If not, how can I get at a sub-list of my Contacts based on when something happened with their Opportunity?

    Thanks!
    Ted

  2. #2
    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: query Contacts based on date field in Opportunities module?

    Hi Ted.

    At first create a Target List, take the id generated for that Target List and after substitute it in this query:

    INSERT INTO prospect_lists_prospects (id, prospect_list_id, relate_id, relate_type, date_modified)
    SELECT UUID(), 'prospect_list_id', c.id, 'Contacts', NOW()
    FROM contacts c
    INNER JOIN opportunities o ON xxxx
    WHERE xxxx

    Obviously substitute the xxxx for the appropriate clauses.

    Best 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.

  3. #3
    TedErnst is offline Member
    Join Date
    Jun 2008
    Posts
    8

    Default Re: query Contacts based on date field in Opportunities module?

    Thank you, Andre. I'll see if I can find someone in my company that understands what you wrote. Hopefully they will!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Custom Module Relate Field doesn't show on ListView
    By fxbrandon in forum Developer Help
    Replies: 5
    Last Post: 2008-10-04, 10:05 AM
  2. HOWTO - Hack Sugar to support related module info in subpanel (one-many)
    By kenneth.thorman in forum Developer Tutorials
    Replies: 35
    Last Post: 2008-06-10, 07:51 AM
  3. custom date field default to none
    By sidh211 in forum Help
    Replies: 0
    Last Post: 2008-06-02, 12:28 PM
  4. Adding The Account Sub Panel Module To Contacts
    By SponjWorthy in forum General Discussion
    Replies: 2
    Last Post: 2005-10-28, 10:48 PM

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
  •