I want to add multiple email address to a contact via SOAP api, suppose i register a user from my php app. via registration page with testemail1@test.com for ex., so this will create a new contact in sugarcrm via set entry and "email1" parameter in soap set_entry call, in name_to_value_list array.
Now suppose i update the account information in my php web app. and updates email address to testemail2@test.com , so now, this should add this new email address to the current contact as primary email address and opt out the old email address (as we can add multiple email address to sing contact record).
see the sample code here :
$result = $mySoap->call('set_entry', array($session_id, 'module_name'=>'Contacts', array(
array("name" => 'first_name',"value" => $_POST['first_name']),
array("name" => 'last_name',"value" => $_POST['last_name']),
array("name" => 'email1',"value" => $_POST['email_address']), //Emails is suppose testemail1@test.com for first time
array("name" => 'primary_phone_c',"value" => $primary_phone),
array("name" => 'prefered_contact_c',"value" => $_POST['prefered_contact']),
array("name" => 'primary_address_street',"value" => $_POST['address']),
array("name" => 'primary_address_street_2_c',"value" => $_POST['address_2']),
array("name" => 'primary_address_city',"value" => $_POST['address_city']),
array("name" => 'primary_address_state',"value" => $_POST['address_state']),
array("name" => 'primary_address_postalcode',"value" => $_POST['address_postalcode']),
array("name" => 'address_country_c',"value" => $_POST['address_country']),
)));
So any sample Soap call or any idea like i use email2 field instead email1 in set_entry or else?
Thanks, Dhaval Darji