Results 1 to 5 of 5

Thread: Leads via php/mySQL

  1. #1
    holsum is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    20

    Question Leads via php/mySQL

    I am using PHP to insert leads into my Sugar database from a content management system ( Joomla) .

    Everything works fine except that the Lead email address is not showing in Sugar. I am using 'email1' as the column name and checking the sugar database it is in there. Is there another column that is required in order for the email to show within the Sugar application?

    I am using SugraCRM 5.0 community Edition.

    Thanks,

    -Holsum

  2. #2
    hangdog is offline Junior Member
    Join Date
    Nov 2007
    Posts
    1

    Default Re: Leads via php/mySQL

    First - Nice Job!

    I have the same thing happening when I create a web form form the campaign module.

    everything populates but no email displays in the lead body.

    Any suggestions?

    I'm using Versoin 5.0.0 GA


    If I can get this working I will be a happy man!

  3. #3
    sanjaykatiyar1's Avatar
    sanjaykatiyar1 is offline Sugar Community Member
    Join Date
    Feb 2006
    Location
    Bangalore
    Posts
    600

    Default Re: Leads via php/mySQL

    Hi holsum,

    email1 is the right field in the leads table. If data is going to this field in the 'leads' table then it should show in the sugar application.
    Sanjay Katiyar
    iPhone and Android solutions http://www.apptility.com

  4. #4
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    852

    Default Re: Leads via php/mySQL

    Hello guys,

    here are results of my research for this problem.
    Emails now are being saved very interesting. It is saved in 'email_addr_bean_rel' table.

    And Sugar calls for 'getEmailAddressWidget' function to retreive 'email1'.
    In final, following function returns email:
    PHP Code:
    function getAddressesByGUID($id$module) {
            
    $return = array();
            
            
    $q "SELECT ea.*, ear.* FROM email_addresses ea 
                    LEFT JOIN email_addr_bean_rel ear ON ea.id = ear.email_address_id 
                    WHERE ear.bean_module = '{$module}'
                    AND ear.bean_id = '{$id}' 
                    AND ear.deleted = 0
                    ORDER BY ear.reply_to_address, ear.primary_address DESC"
    ;
            
    $r $this->db->query($q);

            while(
    $a $this->db->fetchByAssoc($r)) {
                
    $return[] = $a;
            }
            
            return 
    $return;
        } 
    So, what you need is just look at mentioned new table.
    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

  5. #5
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    852

    Default Re: Leads via php/mySQL

    By the way, i have not found field 'email1' in 'leads' table
    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 2010-07-15, 02:22 PM
  2. I can see leads that are not assigned to me
    By keak in forum Developer Help
    Replies: 6
    Last Post: 2007-02-05, 05:33 PM
  3. Replies: 2
    Last Post: 2006-12-24, 09:08 AM
  4. Categorize Leads Upon Import
    By eSolutions in forum Help
    Replies: 4
    Last Post: 2005-10-23, 10:39 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
  •