Results 1 to 2 of 2

Thread: update fields with soap(SoapSugarUsers.php)

  1. #1
    shahrzad is offline Junior Member
    Join Date
    Apr 2008
    Posts
    2

    Question update fields with soap(SoapSugarUsers.php)

    hi dears,

    I'm using web service to connect remotly to sugarcrm of different server.(with SoapSugarUsers methods), I counld to use it well but when updating...
    In a separate php page I get two variable. two variable must compare with a query in users table
    in sugarcrm database. if it can find the record, I want to update this record, for example status change to 'Active' value. I think I should use of set_entry , but instead of updating the record, it inserts a new record with 'Active' value in state field. what do you think? I know I'm in mistake to use set_entry and 'query' !
    but how I can update?


    //
    // Get REQUEST variables
    //
    $un = $_REQUEST['un'];
    $sc = $_REQUEST['sc'];


    $user = array(
    'session' => '1',
    'module_name' => 'Users',
    'query' => 'users.email1 = "' . $un . '" and users.his_code="'.$sc.'"',
    'name_value_list' => array(
    array('name'=>"status",'value'=>'Active'),
    )
    );
    ///////// seems to insert a new record, no update!
    $user_list_array = $soapclient->call('set_entry',$user);


    thanks in advance:,
    shahrzad

  2. #2
    shahrzad is offline Junior Member
    Join Date
    Apr 2008
    Posts
    2

    Cool Re: update fields with soap(SoapSugarUsers.php)

    $user_list_params = array(
    'session' => '1',
    'module_name' => 'Users',
    'query' => 'users.email1 = "' . $un . '" and users.his_code="'.$sc.'"',
    'offset' => 0,
    'select_fields' => array('id'),
    'max_results' => 1,
    'deleted' => 0
    );
    $user_list_array = $soapclient->call('get_entry_list',$user_list_params);

    $user_id = $user_list_array['entry_list'][0]['name_value_list'][0]['value'];
    $user = array(
    'session' => '1',
    'module_name' => 'Users',
    'name_value_list' => array(
    array('name'=>"id",'value'=>$user_id),
    array('name'=>"status",'value'=>'Active'),
    )
    );
    $user_list_array = $soapclient->call('set_entry',$user);



    it works,

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 2009-02-11, 02:04 PM
  2. Replies: 1
    Last Post: 2008-02-12, 05:15 PM
  3. SOAP Update Contact
    By iconstantin in forum Developer Help
    Replies: 4
    Last Post: 2006-08-21, 02:03 AM
  4. Update Custom Fields with SOAP
    By dtobias in forum Developer Help
    Replies: 3
    Last Post: 2005-08-31, 06:05 PM
  5. Update custom fields throw SOAP interface
    By stepanov in forum Developer Help
    Replies: 1
    Last Post: 2005-08-17, 11:11 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
  •