Results 1 to 3 of 3

Thread: sugar contact module update

  1. #1
    aljassi is offline Junior Member
    Join Date
    Aug 2011
    Posts
    2

    Question sugar contact module update

    hello everyone,

    i want to make an update in the contact module of sugarcrm but i dont know how it really works.
    can you help me.

    hier is my query for the update

    $server="http://server/sugarcrm/soap.php";
    // include_once WP_PLUGIN_DIR . '/wp-sugarcrm-api-soap/sugarsoapclient.php';
    ..
    // code

    $updateQuery = "contacts.id in ( UPDATE eabr.bean_id SET webtolead_email1='".$email."', primary_address_street='".$street."', primary_address_postalcode='".$postalcode."',prima ry_address_city='".$city."' WHERE last_name='".$contact['last_name']."' AND first_name='".$contact['first_name']."')";
    $updateSoapClient = new sugarSOAPclient( $server );
    $UpdateResult=$updateSoapClient->login( $user_name, $user_password , false );
    $contact_email = $username;
    $contact_password = $password;
    //$contactsUpdate= $updateSoapClient->setEntryList( 'Contacts', $updateQuery, '', 0, '', 1 );
    $contactUpdates= $updateSoapClient->getEntryList( 'Contacts', $updateQuery, '', 0, '', 1 );


    if ($contactUpdates['result_count'] == 1){
    // Convert SugarCRM's name_value_list to an associative array
    $contactUpdate = convertNVLToArray( $contactUpdates['entry_list']['0']['name_value_list']);

    }
    $updateSoapClient->logout();
    }


    the code does not work and i spent a lot of time but i cant fix the problem
    can someone help me?

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

    Default Re: sugar contact module update

    Not exactly sure why you need soap here but I see you trying to run an Update from within an IN clause which shouldn't work. You may want to try something similar (not tested) to:
    PHP Code:
    global $db;
    $updateQuery " UPDATE eabr.bean_id SET webtolead_email1='".$email."', primary_address_street='".$street."', primary_address_postalcode='".$postalcode."',prima ry_address_city='".$city."' WHERE last_name='".$contact['last_name']."' AND first_name='".$contact['first_name']."'";
    $db->query($updateQuery); 

  3. #3
    aljassi is offline Junior Member
    Join Date
    Aug 2011
    Posts
    2

    Default Re: sugar contact module update

    hi,

    do you know another way to do that without using soap?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Update contact field from calls module
    By japtone in forum Developer Help
    Replies: 1
    Last Post: 2011-03-15, 06:53 PM
  2. Replies: 0
    Last Post: 2009-06-23, 10:56 AM
  3. Logic hook for update Account after update Contact
    By sugaradmin in forum Developer Help
    Replies: 11
    Last Post: 2008-11-28, 03:12 PM
  4. Replies: 2
    Last Post: 2008-02-06, 01:59 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
  •