我在这里做了一些奇怪的事情,我正在查询我的本地数据库中的数据,并使用cURL将它提供给Salesforce表单。数据正确发布到Salesforce。但是,选择倍数没有得到正确的选定值。请参阅下面的代码中的$ sd [“location”]:如何发布到表单并填充选择多个?
//init curl
$ch = curl_init();
//setup the params
$url = 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
$oid = "HIDDEN";
//setup the superdelegate array
$sd = array();
$sd["oid"] = $oid;
$sd["retURL"] = "";
$sd["first_name"] = "1144asdfsadf4";
$sd["last_name"] = "SDFSD1111";
$sd["state"] = "IL";
$sd["location"] = '"Chicago","New York","California"'; //this is the value that submits to the select multiple
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($sd));
//post to Salesforce and then close the connection
curl_exec($ch);
curl_close($ch);
Salesforce中的选择倍数已在30个不同位置中设置。我试图通过应该选择的城市(芝加哥,纽约,加利福尼亚州)。你能帮我修复我的代码,让这个工作正常吗?
那么,我给了一个镜头,并没有在Salesforce中选择的位置。标签和值完全相同,所以不应该是问题。嗯....任何其他想法? – mike 2010-10-22 21:46:21
尝试使用散列而不是数组数组可能对于上面的代码您可以使用'$ sd ['location'] = array_combine($ sd ['location'],$ sd ['location']);'at the结束。 – prodigitalson 2010-10-23 00:23:39