AnsweredAssumed Answered

Update email_address_id, bean_id ,bean_module - Sugarcrm REST API

Question asked by demonblade on Mar 16, 2015
Latest reply on Mar 23, 2015 by demonblade
Im working on sugarcrm rest api to update a candidate email address. Firstly I'm updating in email_addresses table and then on email_addr_bean_rel table.
  • For each table update, I'm creating session id and pass through api.

  • On running the api, it updates the values in email_addresses table but not on email_addr_bean_rel table.

Whether i need to set any relationship??

Please help me to solve this issue...


//login --------------------------------------------- 
$login_parameters = array(       "user_auth" => array(            "user_name" => $username,            "password" => md5($password),            "version" => "1"       ),       "application_name" => "RestTest",       "name_value_list" => array(),  );    $login_result = call("login", $login_parameters, $url);    //get session id  $session_id = $login_result->id;     $set_entry_parametersEADDR = array(       //session id       "session" => $session_id,         //The name of the module from which to retrieve records.       "module_name" => "EmailAddresses",         //Record attributes       "name_value_list" => array(          array('name' => 'email_address', 'value' => $_POST['emailid']),       array('name' => 'email_address_caps', 'value' => strtoupper($_POST['emailid'])),      array('name' => 'invalid_email' , 'value' => 0),      array('name' => 'opt_out', 'value' => 0),       array('name' => 'date_created' , 'value' => date('Y-m-d H:i:s')),      array('name' => 'date_modified', 'value' => date('Y-m-d H:i:s')),       array('name' => 'deleted' , 'value' => 0),       ),  );    $set_entry_resultEmailsAdd = call("set_entry", $set_entry_parametersEADDR, $url);    echo "<pre>";  print_r($set_entry_resultEmailsAdd);  echo "</pre>";            //login ---------------------------------------------   $login_parameters = array(       "user_auth" => array(            "user_name" => $username,            "password" => md5($password),            "version" => "1"       ),       "application_name" => "RestTest",       "name_value_list" => array(),  );    $login_result = call("login", $login_parameters, $url);    //get session id  $session_id = $login_result->id;     $set_entry_parametersEmailAddressBean = array(       //session id       "session" => $session_id,         //The name of the module from which to retrieve records.       "module_name" => "EmailAddresses",        //Record attributes       "name_value_list" => array(          array('name' => 'email_address_id', 'value' => $set_entry_resultEmailsAdd->id),       array('name' => 'bean_id', 'value' =>  $set_entry_result->id),      array('name' => 'bean_module' , 'value' => 'gaur_Candidates'),      array('name' => 'primary_address', 'value' => 1),       array('name' => 'reply_to_address', 'value' => 0),      array('name' => 'date_created' , 'value' => date('Y-m-d H:i:s')),      array('name' => 'date_modified', 'value' => date('Y-m-d H:i:s')),       array('name' => 'deleted' , 'value' => 1),          ),  );      $set_entry_resultEmailBean = call("set_entry", $set_entry_parametersEmailAddressBean, $url);    echo "<pre>";  print_r($set_entry_resultEmailBean);  echo "</pre>";

Outcomes