Results 1 to 5 of 5

Thread: Sugar5 SoapTest.php Error with Mysql 5

  1. #1
    abrahamelias is offline Junior Member
    Join Date
    Jan 2008
    Posts
    1

    Default Sugar5 SoapTest.php Error with Mysql 5

    When running the SoapTest.php in the examples dir of sugar 5 using mysql 5 I get the following error:

    Update a portal user fields:
    HERE IS ERRORS:
    Response not of type text/xml

    HERE IS RESPONSE:
    HTTP/1.1 200 OK Date: Wed, 02 Jan 2008 04:34:58 GMT Server: Apache/2.2.4 (Ubuntu) DAV/2 SVN/1.4.4 PHP/5.2.3-1ubuntu6 mod_ssl/2.2.4 OpenSSL/0.9.8e X-Powered-By: PHP/5.2.3-1ubuntu6 Set-Cookie: PHPSESSID=df77896324b4fc280a296ad958ae8c9c; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-Length: 238 Connection: close Content-Type: text/html Retrieving record WHERE deleted = '0' AND email1 = 'Dan_Aarons@example.com' AND deleted=0: Query Failed:SELECT contacts.* FROM contacts WHERE deleted = '0' AND email1 = 'Dan_Aarons@example.com' AND deleted=0 LIMIT 0,1::MySQL error 1054:


    email1 is not a column in the contacts table. Suggested work around?
    Last edited by abrahamelias; 2008-01-02 at 04:07 AM.

  2. #2
    genimo is offline Member
    Join Date
    Dec 2007
    Posts
    8

    Default Re: Sugar5 SoapTest.php Error with Mysql 5

    I'm getting similar error from Web Service call to query contacts by email1 (or email2). Is there way to find contact using email from SOAP?

    Thanks!

  3. #3
    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: Sugar5 SoapTest.php Error with Mysql 5

    Hi, all.

    email1 and email2 are not columns of Person modules anymore.
    SugarCRM 5.0 works in different way to emails.
    There is another module just to manage email addresses and there are relationships between this one and all Person modules.

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

  4. #4
    genimo is offline Member
    Join Date
    Dec 2007
    Posts
    8

    Default Re: Sugar5 SoapTest.php Error with Mysql 5

    André, thanks for the reply!

    Any idea where can I find information about that module? And specifically how it can be used to query contacts by email using Sugar Web Service API?

  5. #5
    jaenglish is offline Junior Member
    Join Date
    Apr 2008
    Posts
    3

    Default Re: Sugar5 SoapTest.php Error with Mysql 5

    I've also been searching for an easy way to do this. I can't seem to find one, but there is something of a workaround using other functions. Where I used to call the API as follows:

    Code:
    $result=$this->soap->get_entry list(
         $session,                              // session id
         'Contacts',                            // module name
         " contacts.email1='".$email."',        // query
         ' contacts.last_name',                 // order by
         0,                                     // offset 
         array(),                               // array of fields to be retrieved 
         1,                                     // max number of entries to retrieve
         false                                  // whether to show deleted entries
    );
    Clearly this will no longer work, since 'email1' is no longer a field in the contacts database. The way around this is to use the contact_by_email function in the api to grab the id for the contact:

    Code:
    $contact = $this->soap->contact_by_email(SUGAR_USER, SUGAR_PASS, $email);
    Then we can use this id to retrieve the rest of the contact information:

    Code:
    $result=$this->soap->get_entry list(
         $session,                              // session id
         'Contacts',                            // module name
         " contacts.id='".$contact[0]['id']."', // query
         ' contacts.last_name',                 // order by
         0,                                     // offset 
         array(),                               // array of fields to be retrieved 
         1,                                     // max number of entries to retrieve
         false                                  // whether to show deleted entries
    );
    This seems to be pretty foolproof since the user ID's are unique values, and looking up a contact by his or her ID is the most certain way to find that contact. The only thing this does NOT check for is more than one contact with the same email, but if that happens, you have duplicate record problems anyway.

    Hope this helps. It's the only workaround I know for the time being, and I'm by no means an expert with SOAP or Sugar.


    -jae
    Last edited by jaenglish; 2008-04-28 at 09:09 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 2007-11-13, 02:51 PM
  2. MySQL Database Not Available
    By luisamato in forum Help
    Replies: 4
    Last Post: 2007-06-27, 05:58 AM
  3. Huge backups -- normal?
    By Liam in forum Help
    Replies: 5
    Last Post: 2007-05-02, 05:36 AM
  4. Replies: 7
    Last Post: 2007-02-14, 03:48 PM
  5. MySQL error/no workflow notifications
    By rlbyrd in forum Help
    Replies: 1
    Last Post: 2006-09-11, 09:14 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
  •