我想通过SOAP api向联系人添加多个电子邮件地址, 假设我从我的php应用程序注册用户。通过注册页面与testemail1@test.com进行交流,这样就可以通过set set和soap set_entry调用中的“email1”参数在name_to_value_list数组中在sugarcrm中创建一个新联系人。
现在假设我在我的php网络应用中更新帐户信息。并将电子邮件地址更新为testemail2@test.com,现在,这应该将此新电子邮件地址作为主电子邮件地址添加到当前联系人,并选择退出旧电子邮件地址(因为我们可以添加多个电子邮件地址来播放联系人记录)。
请在此处查看示例代码:
$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']),
)));
所以任何样本Soap调用或任何想法,比如我在set_entry中使用email2字段而不是email1,否则?
谢谢, Dhaval Darji